i´m trying to populate a ContentCollection on a child page with the content from a ContentCollection of its parent page, so that i don´t have to define the same content multiple times, parent and child are using different page layouts. Somebody know if this is possible and can help?
You don’t really need a ContentCollection in the child page, you can get the content from the parent page, with a FlowQuery, and render those node in the child page. We use this kind of thing on the opposite direction to render big one pager. From the main page we get all contents from subpage, and render everything in a single page.
# Get the parent document, if you use Your.Package:SectionHomePage as node type for the parent document
parentSectionDocument = ${q(documentNode).closest('[instanceof Your.Package:SectionHomePage]').get(0)}
# If the content collection is at path 'sidebar'
parentSectionCollection = ${q(this.parentSectionDocument).find('sidebar').get(0)}