Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Themes & Styling

Allow end user to edit footer partial like they do for pages

Solved by Paul Hibbitts View solution

Started by Chris Lloyd 9 years ago · 2 replies · 1547 views
9 years ago

What is the best way to allow the end user to customize the content in the footer which appears on every page?

Currently the footer is a partial twig template and is included in the base.html.twig partial. It isn't a "page" but I want to let the end user edit the footer like they do pages.

9 years ago Solution

Hi @Sockfuzz, I like to provide a non-routable folder called footer for this, so users can edit footer content just like any page.

Here is an example footer page from my Course Hub skeleton:
https://github.com/hibbitts-design/grav-skeleton-course-hub/blob/master/pages/footer/default.md

And here is some example Twig to check/display the footer:
https://github.com/hibbitts-design/grav-theme-course-hub-bootstrap/blob/master/templates/partials/base.html.twig#L66-L69

Hope the above helps,
Paul

9 years ago

Thank you for the quick answer!

That is exactly the type of thing I am looking for. I didn't know you could organize content like that by making a folder type page that is non-routable. My mind was just blown.

👍 1

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 193 2 months ago
Themes & Styling · by Ian, 2 months ago
3 91 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 451 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 45 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 125 3 months ago