[SOLVED] Page properties by layout?


(George Dimitriadis) #1

Hello,

coming from other CMS logic, I was used to assigning data to a page based on its layout, so for example I would have a layout for the homepage, a layout for a general content page and assign different data to these pages.

So, the homepage could have a header image for example, while the content page would have something else and no image.

Now, in Neos I see that the properties are defined on the NodeType and the layout is just mapping the template for this NodeType, which makes sense, since the layout is “the way the data is presented”. My question is: Is it possible / a good practice to assign properties and child nodes to a page based on its layout, or should I just create another NodeType for a different kind of page and assign its properties there ?


(Bastian Waidelich) #2

yes, you should :wink:
Creating new document and content element types is really “cheap” in Neos (as in: easy to do and fast to render) and it has a lot of advantages to do it that way.

See https://neos.readthedocs.io/en/stable/HowTos/SelectingPageTemplate.html#select-template-based-on-nodetype for a simple way to implement this


(George Dimitriadis) #3

Alright, thanks Bastian, I’ll do it with NodeTypes then, thanks for the tips !