How to insert a custom .png logo in header (Future2021)

Hi there,

I have been trying to add a custom .png logo in the header of the grav site I am building. See here what I am referring to:

I explain here the steps I have followed:

  1. I already had created an inherited theme using CLI.
  2. Checked the parent theme templates to check for the template where I want to add the custom logo. In parent theme, it is located here: user/themes/future2021/templates/partials/header.html.twig
  3. Therefore, I copy-pasted “header.html.twig” into “future2021-child-theme-2/templates/partials/”.
  4. I identified the line of code that, before any changes, displays just the name of the site in text format, so not an image. Looks like this:
<header id="header">
  <div class="logo">
    <a href="{{ home_url }}">{{ site.title }}</a>
  </div>
  1. Then, I check for the folder path where the logos are located in the parent theme. Is here: user/themes/future2021/images/logo/grav_logo.png. My logo will be named “logo.png”.
  2. I replicate the above folder structure in the child-theme. Add the “logo.png” in the logo folder
  3. I change the code in the header to the below:
<header id="header">
  <div class="logo">
    <a href="home"><img src="../../images/logo/logo.png" alt="I want a logo here"></a>
  </div>

→ Result a) With alt text, then it only shows the alt text.

→ Result b) If I remove the alt text, then it shows this:
image

The linking to the homepage from other pages works well for both a) and b). When this above failed, I started troubleshooting. See below my ideas:

First idea to solve it:
I had seen this post’s answer, so I decided to try.

  1. Added the following in the child-theme.yaml
custom_logo:
   - name: logo.png

→ Result: nothing happened. Still a) and b) results.

Second idea to solve it:
“Perhaps is not only the header that I should edit, since I see that there is a “logo.html.twig” file in the parent folder which maybe is affecting the not rendering of my custom logo.”

  1. Copy this “logo.html.twig” into the child theme in the same folder path as the parent is.
  2. The original parent theme code for “logo.html.twig” one is as follows:
{% set logo = theme_var('custom_logo_mobile') ?: theme_var('custom_logo') %}
<a href="{{ home_url }}" class="logo" rel="nofollow" title="{{ site.title|raw }}">
  {% if logo %}
    {% set logo_file = (logo|first).name %}
    <img src="{{ url('theme://images/logo/' ~ logo_file) }}" alt="{{ site.title|raw }}"/>
  {% else %}
    {% include('@images/grav-logo.svg') %}
  {% endif %}
</a>
  1. In my humble opinion, I believe that what I could change is the following:
{% if logo %}
    {% set logo_file = (logo|first).name %}
    <img src="{{ url('theme://images/logo/logo.png' ~ logo_file ) }}" alt="{{ site.title|raw }}"/>

→ Result: same as in the results a) and b) of above.

Third idea to solve it:
"Maybe the problem is in the location of the logo in the folder structures. I see that the grav logo is not only located in the logo folder, but there is also a grav logo (in .svg format) in the “future2021/images/” folder.
On this line of thought, I started putting my custom logo to all the paths that could make sense (since it doesn’t work with my first option above). I made the link everytime in the header.html.twig to point to each of the different folder and I cleared cache everytime.

  1. “themes/future2021-child-theme-2/images/logo.png”
  2. “user/pages/images/logo.png” (so putting it in the hidden folder of images that is located where the blog pages and other are)
  3. “user/themes/future2021-child-theme-2/templates/partials/logo.png” → makes no sense but I tried…
    → Result: same as a) and b) above.

Fourth idea to solve it:
I saw this answer in this post which gives directions to make changes in the “base.html.twig” for the antimatter theme (not future2021) and then of course it’s not the same… However, in the Future2021 “base.html.twig” I saw this lines of code which maybe serve as an idea to anyone reading this post:

{# Define if the primary image and the attributes of width and height are shown #}
{% set show_image = header_var('show_pageimage')|defined(true) %}
{% set image = page.media[page.header.primaryImage] ?: page.media.all|filter((v, k) => k != page.header.avatarImage and (v.type == 'image' or v.type == 'vector'))|first %}
{% set img_width = header_var('image_width')|default(1038) %}
{% set img_height = header_var('image_height')|default(437) %}

I did not dare to make changes here because I hardly understand… but I leave it here in case it helps give ideas…

How many questions can one person ask in a month without getting banned? asking for a friend :smiling_face_with_tear: :sweat_smile:

Thanks a lot in any case!! :blush:

2 Likes

Hi.
Could you send an issue to GitHub repo?

The Future2021 theme is prepared to include the logo in image format, but it is not implemented in the header. It is something pending to finish.

I will revise it as soon as possible

1 Like

In the next version of the theme, the logo will appear in the Editorial theme, with the possibility of establishing image and text or only text or only image.

Hi Pedro,

Done, I just created the issue. Thanks a lot for your answer and for your theme developments!!

Hi Pedro,

I have seen the update on the theme, thanks a lot! Could you give me some indication of how should I then add my custom image?

I see that in the header you point to include the contents in logo.html.twig, but I am not sure how is then made to display my custom logo.

Here the code I have doubts about:

  {% if logo %}
    {% set logo_file = (logo|first).name %}
    <img src="{{ url('theme://images/logo/' ~ logo_file) }}" alt="{{ site.title|raw }}" class="{{ logo_class }}"/>

I have tried to point it to: url('theme://images/logo/logo.png' but nothing updates.

Thanks very much

Do you have the logo variable defined in the theme configuration, in config/themes/future2021.yaml?

In logo.html.twig, in the first line of set that variable as follows:

{% set logo = theme_var('custom_logo_mobile') ?: theme_var('custom_logo') %}

From the theme administration panel it is easy to do, you just have to choose the image file you want to use as a logo, and it will be saved in the images/logo folder.

Please check within the demo files, included with the theme, the future2021.yaml theme configuration file.
You should have something like this:

custom_logo:
  user/themes/future2021/images/logo/Grav_logo.png:
    name: Grav_logo.png
    type: image/png
    size: 15355
    path: user/themes/future2021/images/logo/Grav_logo.png
custom_logo_mobile: {  }

Thanks for your reply Pedro!! And sorry for my late answer, had to get a new pc since my old one perished :smiling_face_with_tear:

Yes. When I tried using the theme admin panel it worked and my custom logo appeared. Thanks!

However, I am trying to see my logo implemented in a child theme from Future2021 and I don’t manage to make it.

What I have tried:

  1. I put the correct path to point my custom logo in grav-admin/user/config/themes/future2021.yaml
  2. In grav-admin/user/config/themes/ I duplicated the future2021.yaml
  3. Changed the name of the duplicate to future2021-child-theme-2.yaml
  4. Cleared cache. My custom logo does not show up.
  5. Then I suspected that maybe having two yaml files in that same folders could be causing an issue. So I deleted the future2021.yaml file.
  6. Cleared cache. My custom logo does not show up.

Then I also tried:

  1. Copy the _demo folder from grav-admin/user/themes/future2021/_demo/
  2. Change the yaml file name to future2021-child-theme-2.yaml
  3. Wrote the paths to my custom logo under “custom_logo”
  4. Cleared cache. My custom logo does not show up.

I believe I am not hitting the right combination of factors to make the custom logo render in the child theme. From my understanding:

  • My child theme needs to be updated with the changes that you have done in the parent theme;
  • However, the file that you told me to modify is in a folder that is NOT inside the themes, is before: config/themes/future2021.yaml. That’s why I tried duplicating it and giving it the child-theme name.
  • Then, I also need to put in the child theme those files that were modified to allow me to put the custom logo with the configuration that you set up. For that reason I copied the _demo folder into the child theme.

Another thing that I noticed is that a new item appeared in the header in my child theme. It appeared in one of the switches from Future2021 to Future2021-child-theme that I did during the above tries. Look:


It’s not my main issue, but nevertheless curious thing :sweat_smile:
Thanks a lot!

Hi @piccolopi.

Change the yaml file name to future2021-child-theme-2.yaml

Your yaml file is wrong, it would be future2021_child. You are using the name of repo, but the right name is future2021_child, both for folder and yaml file.

Another thing that I noticed is that a new item appeared in the header in my child theme. It appeared in one of the switches from Future2021 to Future2021-child-theme that I did during the above tries. Look:

This is a custom menu item which you can remove from theme settings in admin panel.

Hi Pedro, thanks for your answers.

I followed your instructions and still did not manage to make my custom logo appear in the child theme header.Here’s what I did:

  1. First I was trying to make it with the files I had been using in my last attempt. I did not manage to make it with your above directions, so to avoid any unwanted variables, I downloaded another grav package and created a child theme using CLI and inheritance method from Future2021. To start from 0 and fresh again. I linked in the base.html.twig to the custom.css to be able to see my custom homepage.
  2. Copied the “_demo” folder from the parent theme to the child theme
  3. Rename the yaml file to “future_child.yaml”
  4. Rename the “_demo” folder to “future2021_child” (is this the folder you meant for me to rename?)
  5. Arranged the paths in the “future2021_child.yaml”:
custom_logo:
  user/themes/future2021-child-3/images/logo/logo.png:
    name: logo.png
    type: image/png
    size: 15355
    path: user/themes/future2021-child-3/images/logo/logo.png

  1. In “grav-admin/user/config/system.yaml” I set → pages: theme: future2021-child-3
  2. Cleared cache. The custom logo does not show.
  3. I thought that maybe I also needed to change the name of the yaml file in “grav-admin/user/config/themes/future2021.yaml” to “future2021_child.yaml”. I edited the “custom_logo:” part to look the same as in step 3.
  4. Cleared cache. The custom logo does not show up.
  5. Switched back to the parent theme
  6. Input my custom logo in the theme panel admin
  7. My custom logo shows correctly. THEN, my logic was to inspect the files to see of the parent theme to see if there is anything that I can spot which I might not be replicating correctly in the child theme. Findings:
  • My custom logo shows up BUT the “grav-admin/user/themes/future2021/_demo/config/themes/future2021.yaml” is unchanged, still with the default grav logo settings.
  • Regarding the yaml file located in “grav-admin/user/config/themes/future2021_child.yaml”, I did not change it to “future2021.yaml” and the custom logo still shows correctly.
    → I was not able to find a clue of why it doesn’t work in my child theme… there I link everything as correctly as I know and logo does not show. When in the parent, there is lack of correct referencing and the logo somehow shows correctly :face_with_spiral_eyes:

Sorry, perhaps there is something very basic I am missing. I looked in the documentation for “importing changes of parent theme to child theme” and similar, but couldn’t find anything else try out.
Thanks a lot

@piccolopi look this post.

Your child theme folder, your child theme name in yaml file must be identical.

Your folder for child theme is future2021-child-3. Maybe it is the issue.

Hi Pedro,

I read that page while searching for solutions but besides info on creating a child theme and adding custom css, I did not find anything that could help me on this issue. Plus, the comments pointed me to the grav documentation again haha

They are identical now and the custom logo still does not show up… The folders with identical name are:

  • Theme folder from “/user/themes” is named “future2021-child-3”

  • “_demo” folder now is named “future2021-child-3” → which I don’t understand why should be named like my theme, in the parent folder you called in “_demo” and it works to put the custom logo there anyway.

    • I tried an experiment: I went to the parent theme folder “user/themes/future2021/” and deleted the “_demo” folder. Then switched the theme of the website back to the parent theme. The custom logo shows up. Then, is the “_demo” folder really affecting anything? Plus, the yaml file in “user/config/themes/” is called “future2021-child-3.yaml” and points to the images folder in the child theme, so it means that the parent theme could not take the custom logo directions from there either.
  • yaml file within “/user/themes/future2021-child-3/future2021-child-3/config/” is also called future2021-child-3.yaml

The contents of the _demo folder should be used to create some example pages and overwrite the theme configuration file. You do not have to rename that folder.

I still don’t really understand what your folder structure is.
Could you do a dir > user_folder.txt (Windows) or ls > user_folder.txt (Linux) and capture your folder structure within user/pages and user/themes.

Hi Pedro! Thanks noted the _demo folder point. I rename it to “_demo”. Below the directories. I deleted some fonts, components and pics to make the lists shorter, didn’t remove anything important for the topic at hand.

.
├── 01.home
│   └── index.md
├── 02.blog
│   ├── blog.md
│   └── testarticle1
│       └── default.md
├── 03.Reviews
│   ├── books_blog
│   │   ├── blog.md
│   │   └── last-words-by-george-carlin
│   │       └── default.md
│   ├── _books_mod
│   │   └── banner.md
│   ├── filmography_blog
│   │   ├── blog.md
│   │   └── hunter-x-hunter
│   │       └── default.md
│   ├── _filmography_mod
│   │   └── banner.md
│   └── modular.md
├── 04.vids
│   ├── ancient-history
│   │   └── blog.md
│   ├── _ancient_historymod
│   │   ├── ancient_history_750x1191.png
│   │   └── banner.md
│   ├── athletics
│   │   └── blog.md
│   ├── _athleticsmod
│   │   ├── athletics_750x1189.png
│   │   └── banner.md
│   ├── dystopia
│   │   └── blog.md
│   ├── _dystopiamod
│   │   ├── banner.md
│   │   └── dystopia_750x1189.png
│   ├── modular.md
│   ├── oneself
│   │   └── blog.md
│   ├── _oneselfmod
│   │   ├── banner.md
│   │   └── oneself_750x1189.png
│   ├── _taylors_drawermod
│   │   ├── banner.md
│   │   └── taylors_drawer_750x1189.png
│   ├── webdev
│   │   └── blog.md
│   └── _webdevmod
│       ├── banner.md
│       └── webdev_750x1189.png
├── 05.wharever
│   └── blog.md
├── images
│   ├── ancient_history_dpi_3.png
│   ├── logo_only_750x1189.png
│   ├── logo.png
│   └── name_only_138x23.png
└── user_folder.txt
├── future2021
│   ├── assets
│   │   ├── css
│   │   │   ├── custom.css
│   │   │   ├── fontawesome-all.min.css
│   │   │   ├── font-awesome.css
│   │   │   ├── font-awesome.min.css
│   │   │   ├── glightbox.min.css
│   │   │   ├── google-fonts-local.css
│   │   │   ├── google-fonts-remote.css
│   │   │   ├── main.css
│   │   │   ├── main.min.css
│   │   │   └── misc.css
│   │   ├── fonts
│   │   │   ├── raleway-29-cyrillic-400.woff2
│   │   │   ├── raleway-29-cyrillic-800.woff2
│   │   │   ├── sourcesanspro-22-vietnamese-400.woff2
│   │   │   └── sourcesanspro-22-vietnamese-700.woff2
│   │   ├── js
│   │   │   ├── breakpoints.min.js
│   │   │   ├── browser.min.js
│   │   │   ├── custom.js
│   │   │   ├── glightbox.min.js
│   │   │   ├── jquery.min.js
│   │   │   ├── main.js
│   │   │   └── util.js
│   │   ├── sass
│   │   │   ├── base
│   │   │   │   ├── _page.scss
│   │   │   │   ├── _reset.scss
│   │   │   │   └── _typography.scss
│   │   │   ├── components
│   │   │   │   ├── _actions.scss
│   │   │   │   ├── _author.scss
│   │   │   │   ├── _section.scss
│   │   │   │   ├── _sidebarmenu.scss
│   │   │   │   └── _table.scss
│   │   │   ├── grav-plugins
│   │   │   │   └── _page-toc.scss
│   │   │   ├── layout
│   │   │   │   ├── _footer.scss
│   │   │   │   ├── _header.scss
│   │   │   │   ├── _intro.scss
│   │   │   │   ├── _main.scss
│   │   │   │   ├── _menu.scss
│   │   │   │   ├── _sidebar.scss
│   │   │   │   └── _wrapper.scss
│   │   │   ├── libs
│   │   │   │   ├── _breakpoints.scss
│   │   │   │   ├── _functions.scss
│   │   │   │   ├── _html-grid.scss
│   │   │   │   ├── _mixins.scss
│   │   │   │   ├── _vars.scss
│   │   │   │   └── _vendor.scss
│   │   │   └── main.scss
│   │   └── webfonts
│   │       ├── fa-brands-400.eot
│   │       ├── fa-brands-400.svg
│   │       └── fontawesome-webfont.woff2
│   ├── blueprints
│   │   ├── asset
│   │   │   └── file.yaml
│   │   ├── blog.yaml
│   │   ├── default.yaml
│   │   ├── form.yaml
│   │   ├── item.yaml
│   │   ├── modular
│   │   │   ├── banner.yaml
│   │   │   └── features.yaml
│   │   ├── partials
│   │   │   └── blog-bits.yaml
│   │   └── portfolio.yaml
│   ├── blueprints.yaml
│   ├── CHANGELOG.md
│   ├── future2021.php
│   ├── future2021.yaml
│   ├── images
│   │   ├── avatar.jpg
│   │   ├── error
│   │   │   ├── 403.png
│   │   │   └── 404.png
│   │   ├── grav-logo.svg
│   │   ├── logo
│   │   │   └── logo.png
│   │   ├── logo.jpg
│   │   ├── pic01.jpg
│   │   └── pic12.jpg
│   ├── languages.yaml
│   ├── LICENSE.md
│   ├── README.md
│   ├── readme.png
│   ├── screenshot.jpg
│   ├── templates
│   │   ├── blog.html.twig
│   │   ├── components
│   │   │   └── page-toc.html.twig
│   │   ├── default.html.twig
│   │   ├── error.html.twig
│   │   ├── forgot.html.twig
│   │   ├── formdata.html.twig
│   │   ├── form.html.twig
│   │   ├── forms
│   │   │   ├── data.html.twig
│   │   │   ├── data.txt.twig
│   │   │   └── fields
│   │   │       └── privacy
│   │   │           └── privacy.html.twig
│   │   ├── item.html.twig
│   │   ├── login.html.twig
│   │   ├── macros
│   │   │   └── macros.html.twig
│   │   ├── modular
│   │   │   ├── banner.html.twig
│   │   │   ├── contact.html.twig
│   │   │   └── features.html.twig
│   │   ├── modular.html.twig
│   │   ├── offline.html.twig
│   │   ├── partials
│   │   │   ├── archives.html.twig
│   │   │   ├── base.html.twig
│   │   │   ├── blog_item.html.twig
│   │   │   ├── header.html.twig
│   │   │   ├── langswitcher.html.twig
│   │   │   ├── logo.html.twig
│   │   │   ├── metadata.html.twig
│   │   │   ├── navigation.html.twig
│   │   │   ├── owl-carousel.html.twig
│   │   │   ├── page-bits
│   │   │   │   └── date.html.twig
│   │   │   ├── pagination.html.twig
│   │   │   ├── relatedpages.html.twig
│   │   │   ├── sidebar-bits
│   │   │   │   ├── footer.html.twig
│   │   │   │   ├── intro.html.twig
│   │   │   │   ├── miniposts.html.twig
│   │   │   │   └── recentposts.html.twig
│   │   │   ├── sidebar_left.html.twig
│   │   │   ├── sidebar_navigation.html.twig
│   │   │   ├── sidebar_right.html.twig
│   │   │   ├── simplesearch_item.html.twig
│   │   │   ├── simplesearch_searchbox.html.twig
│   │   │   ├── simplesearch_searchbox_results.html.twig
│   │   │   ├── simplesearch_searchbox_sidebar.html.twig
│   │   │   ├── social.html.twig
│   │   │   └── taxonomylist.html.twig
│   │   ├── portfolio.html.twig
│   │   ├── profile.html.twig
│   │   ├── reset.html.twig
│   │   └── simplesearch_results.html.twig
│   └── thumbnail.jpg
├── future2021-child-3
│   ├── blueprints.yaml
│   ├── CHANGELOG.md
│   ├── css
│   │   └── custom.css
│   ├── _demo
│   │   ├── config
│   │   │   └── themes
│   │   │       └── future2021-child-3.yaml
│   │   └── pages
│   │       ├── 01.welcome
│   │       │   ├── 01._features
│   │       │   │   ├── Elements14-a1.svg
│   │       │   │   ├── Elements14-b1.svg
│   │       │   │   ├── Elements14-c1.svg
│   │       │   │   └── features.md
│   │       │   ├── 02._banner
│   │       │   │   ├── banner.md
│   │       │   │   └── pic07.jpg
│   │       │   ├── 03._contact
│   │       │   │   └── contact.md
│   │       │   └── modular.md
│   │       ├── 02.aboutgrav
│   │       │   ├── 01.page-one
│   │       │   │   ├── default.md
│   │       │   │   ├── juan_avataaars.jpg
│   │       │   │   └── pic02.jpg
│   │       │   ├── 02.page-two
│   │       │   │   ├── 01.subpage-two
│   │       │   │   │   ├── ana_avataaars.jpg
│   │       │   │   │   ├── default.md
│   │       │   │   │   └── pic01.jpg
│   │       │   │   └── default.md
│   │       │   ├── 03.page-three
│   │       │   │   ├── default.md
│   │       │   │   ├── Elements14-c1.svg
│   │       │   │   └── pedro_avataaars.png
│   │       │   ├── 04.what-is-grav
│   │       │   │   ├── default.md
│   │       │   │   ├── Grav-dashboard.png.png
│   │       │   │   └── juan_avataaars.jpg
│   │       │   └── default.md
│   │       ├── 03.blog
│   │       │   ├── 01.post-one
│   │       │   │   ├── item.md
│   │       │   │   └── pic01.jpg
│   │       │   ├── 02.post-two
│   │       │   │   ├── item.md
│   │       │   │   └── pic02.jpg
│   │       │   ├── 03.post-three
│   │       │   │   ├── item.md
│   │       │   │   ├── juan_avataaars.jpg
│   │       │   │   └── pic03.jpg
│   │       │   ├── 04.post-four
│   │       │   │   ├── item.md
│   │       │   │   ├── juan_avataaars.jpg
│   │       │   │   └── pic04.jpg
│   │       │   ├── 05.post-five
│   │       │   │   ├── ana_avataaars.jpg
│   │       │   │   ├── item.md
│   │       │   │   └── pic05.jpg
│   │       │   ├── 06.post-six
│   │       │   │   ├── item.md
│   │       │   │   ├── pedro_avataaars.png
│   │       │   │   ├── pic01.jpg
│   │       │   │   ├── pic02.jpg
│   │       │   │   └── pic06.jpg
│   │       │   ├── 07.post-seven
│   │       │   │   ├── item.md
│   │       │   │   ├── pedro_avataaars.png
│   │       │   │   └── pic07.jpg
│   │       │   └── blog.md
│   │       ├── 04.portfolio
│   │       │   ├── pic01.jpg
│   │       │   ├── pic02.jpg
│   │       │   ├── thumb_pic05.jpg
│   │       │   └── thumb_pic06.jpg
│   │       ├── 05.contact
│   │       │   ├── 04._contact-us
│   │       │   │   └── contact.md
│   │       │   └── modular.md
│   │       ├── 06.readme
│   │       │   └── default.md
│   │       ├── 07.privacy
│   │       │   ├── default.md
│   │       │   └── privacy-policy.jpg
│   │       ├── offline
│   │       │   └── offline.md
│   │       └── thankyou
│   │           └── form.md
│   ├── future2021-child-3.php
│   ├── future2021-child-3.yaml
│   ├── images
│   │   └── logo
│   │       └── logo.png
│   ├── js
│   ├── LICENSE
│   ├── README.md
│   ├── screenshot.jpg
│   ├── templates
│   │   ├── index.html.twig
│   │   ├── modular
│   │   │   └── banner.html.twig
│   │   └── partials
│   │       └── base.html.twig
│   └── thumbnail.jpg
└── theme.txt

Well @piccolopi. Can you install a fresh Future2021 Child Theme from GitHub? You cand do this in Admin panel → Tools → Direct Install.

Test with the default name of theme (future2021_child), and copy all your custom templates, css, js, etc that you need.

I have fixed the slug field in the Future2021 child theme blueprint. Saved the custom logo image to the main theme’s images folder.

Sorry @pmoreno but it still does not work… I did what you said above:

  1. Fresh install of the child theme you provided
  2. Brought the custom.css and custom templates (I have a custom template only for the homepage)
  3. Brought the custom “logo.png” to the folder “user/themes/future2021_child/images/logo/”
  4. Adjusted the “user/config/themes/future2021_child.yaml” to point to the logo with: “path: user/themes/future2021_child/images/logo/logo.png” where necessary.
  5. The custom logo is both in the parent theme “images/logo/” folder as well as in the child theme “images/logo/” folder.
  6. cleared cache. The custom logo does not show up.

Then I tried with the admin panel, so just dragged and dropped my custom logo there in the box. It looked like it had to work just as it works on the parent theme panel. Saved, cleared cache and loaded but the custom logo did not show up. Instead remains the site title in there.

I tried adding a footer title and it appeared in 2 of the 5 pages that I have. I did this just to check another element of the admin panel for the child theme.

I also tried “hardcoding” the image into the header.html.twig as follows:

    <div class="logo">
      
      <a href="{{ home_url }}" class=""><img src="../../images/logo/logo.png"</a>
    </div>

But the custom logo does not appear, instead there appears the “broken image” logo as in “image not found/not loaded”.

I am so sorry this is being so long and complicated. Thanks a lot for your time and answers.

HI @piccolopi.

For some strange reason, the package created by Github of the Future2021 child theme included a blueprints version of the previous theme, which did not include the lines of code that refer to the way the logo is displayed in the header (text , image or both). But in any case, if you had copied the blueprint from the parent theme to the child theme folder, it should work.

I have tested it, on a local installation and it works correctly, you can even see the demo of the Future2021 theme online, working with a child theme.

Hi @pmoreno,

I tried what you say above and it didn’t work. Then, since there has been some back and forth within my files, I decided to start again from scratch. Here all my steps:

  1. Download grav package
  2. Download the child theme that you provided
  3. Install the child theme via direct install
  4. Bring to the child theme my custom homepage, custom.css and the partials/base.html.twig
  5. Copy paste the blueprints.yaml of the parent to the child
  6. Bring the custom logo.png to the child’s folder of “images/logo/”
  7. in “user/config/themes/” in the “custom_logo:” area pointed to the “images/logo/logo.png”
    → custom logo does not show up
  8. Uploaded the logo via the admin panel of the child theme
    → custom logo does not show up
  9. Switched back to parent theme. Uploaded the logo using the admin panel.
    → custom logo shows up
  10. Switched again to the future2021_child theme.
  11. Copied the “_demo” folder from the parent theme to the child theme (just to try it out…)
  12. Then where I had copied it (in “future2021_child/_demo/config/themes/”) I changed the name of the yaml file from future2021.yaml to future2021_child.yaml
    → custom logo does not show up
  13. Then, I thought that maybe the problem is that in the child theme I did not have the templates of “header.html.twig” nor the “logo.html.twig”, so I copied them from the parent theme to the child theme in “templates/partials/”.
    → custom logo does not show up

I see the demo, very nice template, I really want to use it for my blog :slight_smile: Exactly where you have put the grav logo + site name is where I am trying to put the logo.png… I really don’t know what am I doing wrong because if it works for you, so should for me, but it keeps resisting…

Thanks a lot Pedro, as said, I understand if this is too much help to ask.

If you want, I could try setting up your site, with access to the admin panel, you could create a temporary user for me. That’s the only thing I can do at this point, I can’t think of anything else.
Maybe we will discover some bug in your configuration or Future2021 theme.
Send your email to
pmoreno@pmdesign.dev

Hi @pmoreno thank you very much for offering this. Give me some more days to work on it to figure out more. I believe it will be a bug in my own config. I will comment in here once I reach a conclusion.
Thanks a lot again.

Hi @pmoreno ,

I had some side assistance by @pamtbaau on the issue as well. Here are the steps to making it work in a child theme provided by him:

  • Fresh install of Grav
  • Install Future2021: $ bin/gpm install future2021
  • Do you wish to install this demo content? [y|N] (yes/no) [no]: yes
  • This will backup your current user/pages folder to user/pages.01-24-2024-09-44-52, continue? [y|N] (yes/no) [no]: yes
  • Create child theme myfuture using $ bin/plugin devtools new-theme as you have done before following the steps in the docs.
  • Copy the form section of the Future2021 blueprints.yaml to the child theme’s blueprints.yaml
  • Open Admin
  • In section Themes, activate theme Myfuture
  • When theme is activiated, open settings of theme Myfuture
  • Upload your custom logo
  • Set property Show logo/text in header to Image as shown above
  • Save settings
  • Browse to website

Two major things I was doing wrong in my previous steps:

→ I was copying the base.html.twig template from the previous FUTURE2021, not from the new theme update you provided.

→ I was copying the whole document, while I just had to copy the section where the logo updates where specified.

All along the issues were mistakes on my side, apologies for the headache I give you.
Thanks a lot for your support, to both.

2 Likes