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

Antimatter Favicon and Logo

admin

Started by Linus Ackermann 6 years ago · 1 replies · 1120 views
6 years ago

Hello Community

Im new to Grav CMS. I use Antimatter 2.2.0 and i want to add my custom Logo and Favicon to my Webside but i dont find the option in the Theme/Antimatter area to change it.
Anmerkung 2020-08-05 180120|690x213
Im i stupid or is something wrong with my Grav/Antimatter and how could i fix it?

6 years ago

@superserfer,

Update 2025-01-17: Made answer Grav 1.7.* compatible by adding | raw.

Default logo and favicon for Antimatter are located in folder '/user/themes/antimatter/images/'. The favicon is used by default, however, the logo is not. For this we have to change a template.

When making changes to a theme, it is advised to use an inherited theme. If you don't your changes will be overridden when a updated version of Antimatter arrives.

Steps:

  • Create inherited theme by following the steps in the docs.
  • In your inherited theme (let's assume it's called 'mytheme') create folder '/images' and drop your own logo and favicon there. Keep the names 'logo' and 'favicon' for simplicity.
  • Copy file '/user/themes/antimatter/templates/partials/base.html.twig' into folder '/user/themes/mytheme/templates/partials/'
  • Replace line 49, with:
    TWIG
    <a href="{{ base_url == '' ? '/' : base_url }}">{{ media['theme://images/logo.png'].html | raw }}</a>
    
  • Your theme will now override the template and the images from Antimatter.
  • You should now see your own favicon and logo.
last edited 01/17/25 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by Pedro M, 2 months ago
4 232 2 months ago
Themes & Styling · by Ian, 2 months ago
3 120 2 months ago
Themes & Styling · by Norbert, 2 years ago
11 485 3 months ago
Themes & Styling · by Lukáš Findeis, 3 months ago
0 74 3 months ago
Themes & Styling · by Sebadamus, 4 months ago
5 153 3 months ago