I need a sidebar on my website which can be edited like normal grav page. The sidebar is in the template/partial. How can i get the content of my page "sidebar" imported?
Archive
Well, with twig it is easy:
TWIG
{% include 'partials/sidebar.html.twig' %}
There is several grav skeletons that use sidebar, take a look at antimatter or Pinpress.
Hope it helps!
thanks - this works, no more global error. But how do i get file user/pages/sidebar/sidebar.md into the twig-file?
the file is user/pages/sidebar/default.md of course...
Use {{ pages.find('/sidebar').content }}
Great - it works ! Thanks !
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1355 | 9 years ago | ||
| 2 | 935 | 9 years ago | ||
| 2 | 4065 | 9 years ago | ||
| 1 | 2953 | 9 years ago | ||
| 3 | 1119 | 9 years ago |