Skip to content

Restrict content types to certain templates as well as regions? #403

Description

@DrMeers

created_content_type(regions=...) feels too limited to me -- what if I have ten different templates each with a 'main' region, and I only want to allow ContentTypeX in the 'main' region of TemplateA? Am I missing something here? Currently this requires manually namespacing all registered regions like 'templatea-main', etc, but that gets messy and has a flow-on maintenance effect in calls to {% feincms_render... %} etc.

I suspect a syntax something like regions=('TemplateA.main', 'other', 'Contact.sidebar', 'OtherTemplate.') might work well -- this would allow the content in TemplateA's main region, regions keyed 'other' in *any template, Contact template's 'sidebar' region or any region within OtherTemplate. Alternatively we could introduce a templates kwarg, but I think the former is more flexible/powerful and nicely backward compatible.

This may also prompt a rethinking of the _feincms_all_regions internals to maintain a {template_key: regions} dictionary or similar instead.

Any thoughts/suggestions? I may embark upon this shortly...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions