Search code examples
phptemplatestwigyamlgrav

GRAV cms - constant footer or sidebar


I wanna have a constant sidebar or footer that i can edit in the grav admin backend. Cant find any similar example on the web.

At the moment i have a normal page folder structure:

pages
 ├── 01.home
 ├── 02.contact
 └── 03.program

now i wanna include on each site the same footer or sidebar - which i can edit in the backend. My shitty solution for this is to implement a form in the template blueprint.yaml so that i add the footer and sidebar stuff in there.

But i think there is an better solution for this - which i cant find. I thought of such a partial or module which i can include in the template then.

Regards Karl


Solution

  • This is typically done via partials. Your theme should have a base file (in the partials directory) that contains a content block. This same file should also include other files such as your sidebar and footer.

    Then, each template type should override the content block.