Neos CMS
4.3
  • Getting Started
  • Technical Principles
  • Creating a Site with Neos
  • Extending Neos
  • Inside of Neos
  • References
  • Contribute
  • How To’s
    • Neos Best Practices (to be written)
    • Adding A Simple Contact Form
    • Changing the Body Class with a condition
    • Changing Defaults Depending on Content Placement
    • Creating a simple Content Element
    • Customize Login Screen
    • Editing a shared footer across all pages
    • Extending the Page
    • Integrating a JavaScript-based slider
    • Rendering Custom Document Types
    • Rendering a Menu
    • Rendering a Meta-Navigation
    • Tagging assets automatically
    • Translating content
    • Wrapping a List of Content Elements
  • Neos Operations
  • Appendixes
Neos CMS
  • »
  • How To’s »
  • Editing a shared footer across all pages
  • Edit on GitHub
Previous Next

Editing a shared footer across all pages

A shared footer in Neos works as follows:

  • The homepage contains a collection of content elements

  • The same collection is rendered on all other pages

This enables you to edit the footer on all pages.

To add the footer to the page you use the ContentCollection with a static node path.

To have the collection on the homepage you need to configure the childNodes structure of the homepage. For this you create a homepage node type with for example the following configuration in NodeTypes.yaml:

'My.Package:HomePage':
  superTypes:
    'Neos.NodeTypes:Page': TRUE
  ui:
    label: 'Homepage'
  childNodes:
    footer:
      type: 'Neos.Neos:ContentCollection'

Note

If you run into the situation that the child nodes for your page are missing (for example if you manually updated the node type in the database) you might have to create the missing child nodes using:

./flow node:repair --node-type Neos.NodeTypes:Page

Fusion code:

footer = Neos.Neos:ContentCollection {
        nodePath = ${q(site).find('footer').property('_path')}
        collection = ${q(site).children('footer').children()}
}

Of course you have to update the selection in the example if your footer is not stored on the site root, but for example on a page named ‘my-page’. The selection would then be: ${q(site).find(‘my-page’).children(‘footer’).children()}.

Previous Next

© Copyright 2006 and onwards by the authors. Revision 03af460e.

Built with Sphinx using a theme provided by Read the Docs.