Skip to content
Grav 2.0 is officially stable. Read the announcement →
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 · 1741 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 Sebadamus, 7 days ago
5 148 15 hours ago
Themes & Styling · by martynfoster735, 1 week ago
1 193 1 week ago
Themes & Styling · by Justin Young, 3 weeks ago
1 241 3 weeks ago
Themes & Styling · by Slebeig, 1 month ago
4 376 1 month ago
Themes & Styling · by Pedro M, 3 months ago
4 745 3 months ago