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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Show custom meta data on page content

Started by Natalia Bazilenco 3 years ago · 3 replies · 396 views
3 years ago

Hi, I added a custom meta data on configuration page - slogan-
And now I try to show the slogan on home page after site title.
i try different options

TWIG
<h3>{{ site.slogan.meta }}</h3>
<h3>{{ site.slogan}}</h3>
<h3>{{ site.meta.slogan }}</h3>

but doesnt work. Can you help me please.

3 years ago

@NataliaB, You question would be more informative if you could share the slogan section in /user/config/site.yaml

3 years ago
YAML
metadata:
  description: 'short text about my company'
  slogan: 'We r the best'
3 years ago

I think you should concatenate site title with page metadata. For example:

TWIG
<h3>{{ site.title|e('html') }} - {{ page.metadata.slogan|raw }}</h3>

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
2 60 16 hours ago
Support · by Anna, 3 days ago
2 66 19 hours ago
Support · by Justin Young, 20 hours ago
1 34 20 hours ago
Support · by Duc , 1 week ago
2 70 6 days ago
Support · by Colin Hume, 1 week ago
2 61 6 days ago