sulu-workshop
sulu-workshop copied to clipboard
03 - Add a footer navigation to the website
Add a footer navigation to the website
Goal
Right now, our website displays a static footer section on every page. We want to provide a way to manually manage the links displayed in our footer section to our content manager.
Steps
- Add a new navigation-context
footer
to theconfig/webspaces/example.xml
file - Log into the admin UI with user "admin" and password "admin"
- Create a new page and add the page to the footer navigation via the settings tab
- Output the new
footer
navigation in yourtemplates/base.html.twig
Hints
- Have a look at the existing
main
navigation-context
More Information
Sulu allows to define multiple so called navigation contexts to which the content manager can add an arbitrary number of pages. Navigation contexts are defined in the navigation-section of the webspace configuration and can be assigned to a page via the settings tab in the administration interface.
After defining a navigation context, a developer can retrieve the navigation for a given context by using Twig extensions delivered with Sulu. The provided Twig extensions allow to retrieve a flat list of pages or a complete nested navigation tree.
Links
- Next assignment pull request: 04 - Add additional languages to the website
- Source file of this assignment: assignments/03.md