Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 403 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to Add Header and Footer in Grav CMS

#1
I know how to add content in Grav CMS but i am facing problem in how to add a header section in Grav CMS. Please tell me where do i have to write the code for header and footer. In (.md) files or twig files?
Reply

#2
As domsson already noted, there are more than a single way to do it in Grav

1. You can check implementation of it in (default) [Quark theme][1]:
`templates/partials/base.html.twig`, which is used by all other templates, have in needed location `{% include 'partials/footer.html.twig' %}` and `footer.html.twig`, in turn, contain all needed data for rendering on page

2. You can also see (use) idea from [Open Publishing Space skeleton][2]

` {# display footer markdown page - hibbittsdesign.org #}
{% set content = pages.find('/footer').content %}
{% if content %}
{{ content|raw }}
{% endif %}`

Here ordinary page (/footer) from site (editable as much as needed) used instead of template and have anything in it, it's content used as site-footer

3. If you have site with modular-pages only (like, f.e. [Deliver skeleton][3]), you can also (except using base-template as per p.1) add to **all** modular-collections

` content:
items: @self.modular
…`

page, which share common template (and data)

[1]:

[To see links please register here]

[2]:

[To see links please register here]

[3]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through