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

Logo on different pages

Started by Muut Archive 11 years ago · 7 replies · 333 views
11 years ago

For example for Home page I need logo with bright colors and for other pages darker style. Does anyone have a qucik idea how to put one logo on Home and another to other pages?

11 years ago

Just an idea, you could have a page header setting body_classes: home and add some CSS to use a different logo in the homepage.

Or, edit the theme's template and add a twig if to determine if it's the homepage, and edit the HTML generated accordingly.

11 years ago

Got a similar problem.. Would like to use different logo when ppl press different tag:

11 years ago

Need more details: where are people pressing a tag link? Example of a link? Which theme are you using / based your theme on?

11 years ago

flaviocopes:
Theme: Sora Article, and if people press example tag:photography i would like to use different logo with that "sub site".

11 years ago

Go in [theme]/templates/partials/base.html.twig and change

TWIG
<img id='Header1_headerimg' src='{{ theme_url }}/images/logo.png' style='display: block' alt='{{ site.title }}' />

to

TWIG
<img id='Header1_headerimg' src='{{ theme_url }}/images/logo-{{ grav.uri.param('tag') }}.png' style='display: block' alt='{{ site.title }}' />

Or create a more complex structure using if tags to determine what to do based on the tag param.Like

11 years ago

flavioscopes: Wow, it worked thanks man!

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