Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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 · 1967 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 MarkP, 7 days ago
3 121 3 days ago
Themes & Styling · by TomW, 6 days ago
0 64 6 days ago
Themes & Styling · by themetman, 2 weeks ago
1 159 1 week ago
Themes & Styling · by AH, 4 weeks ago
1 274 2 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1458 2 weeks ago