You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each region holds a list of content types that can be used in that region. Unfortunately, this list is built when a concrete content type is created, so calling register_templates again later will add regions that have no content types at all.
I can paper over this by patching in all content types here
forregioninPage._feincms_all_regions:
ifnotregion._content_types:
region._content_types=Page._feincms_content_types.copy() # copy is important otherwise CTs will be duplicated
but that is not always what is wanted, since I can't restrict CTs to a region that way.
If we ever want to restrict a CT to a certain region, things will become more complicated (the region set for each CT is not stored anywhere, so that information is lost once the CT has been instanciated).
Food for thought...
The text was updated successfully, but these errors were encountered:
I have done some work in the past trying to rebuild ItemEditor on top of ContentEditor in the past since the latter fixes a few ugly bugs (e.g. it's easy to crash the formset handling code when using ItemEditor's frontend) but haven't really gotten that far. It shouldn't be hard but I got confused while looking at the contentblock_init_handlers and contentblock_move_handlers. ContentEditor doesn't need them as much because it doesn't actually move blocks around in the DOM, it only reassigns the FlexBox order property.
Actually, it would also be nice to restrict CTs to regions of a certain template (or template list). Currently, the only way is to creatively name your regions (ie. 'template1-main', 'template2-main'...), which doesn't play well with {% extends somebasetemplate.html %} that only knows how to render 'main'.
Perhaps overloading the regions parameter for create_content_type with a container class like that:
Context: When creating a FeinCMS site using some kind of plugin mechanism, I ran into this problem.
Each plugin wants to contribute some Template to the main project. To do that, it will do something like
This will not work.
Each region holds a list of content types that can be used in that region. Unfortunately, this list is built when a concrete content type is created, so calling
register_templates
again later will add regions that have no content types at all.I can paper over this by patching in all content types here
but that is not always what is wanted, since I can't restrict CTs to a region that way.
If we ever want to restrict a CT to a certain region, things will become more complicated (the region set for each CT is not stored anywhere, so that information is lost once the CT has been instanciated).
Food for thought...
The text was updated successfully, but these errors were encountered: