Visitar URL original
Restrict content types to certain templates as well as regions? · Issue #403 · feincms/feincms · GitHub
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

  1. matthiask commented on May 17, 2013

    @matthiask
    Member

    I think that's a good idea in principle.

    If we go down this road we should also think about enforcing those restrictions in the backend. Right now it's easily possible to add a content type to one region, and move it to another where the same content type cannot be added directly. The current restriction of content types to certain regions really only has an influence on the content-type dropdown...

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