Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Body_classes how to use?

Started by Muut Archive 11 years ago · 2 replies · 1824 views
11 years ago

i'm working on modular skeleton template, and i've found this in the headers :

body_classes: "modular header-image fullwidth"

how to use that? how this is working?
i was searching inside the documentation but i haven't found nothing, i can also collaborate to write some nice documentation (grav documentation it's ++++++ really nice!)

11 years ago

It's not in the docs because its not a grav core features.. It's merely something that is supported by the Antimatter theme. Basically if you look in the templates/partials/base.html.twig of Antimatter you will see:

https://github.com/getgrav/grav-theme-antimatter/blob/develop/templates/partials/base.html.twig#L42-L42

TWIG
<body id="top" class="{{ page.header.body_classes }}">

So basically this means that Antimatter theme, is looking for this page header and setting it on the <body> tag. This can be used by CSS to target any page.

Grav is super flexible allowing you to do things like this. This is not a specific configuration like you might see in other CMS platforms because it's totally free-form and unstructured.

Imagine it, then make it happen :) That's the Grav way :)

11 years ago

uahuuu, really speedy answer :-)
thank you, i will look into that :-D

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1336 9 years ago
Archive · by Muut Archive, 9 years ago
2 925 9 years ago
Archive · by Muut Archive, 9 years ago
2 4056 9 years ago
Archive · by Muut Archive, 9 years ago
1 2941 9 years ago
Archive · by Muut Archive, 9 years ago
3 1112 9 years ago