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.

General

Edit to navigation.html.twig doesn't show

Solved by Andy Clark View solution

Started by Andy Clark 3 years ago · 3 replies · 399 views
3 years ago

Hi, new to Grav. I made a theme and wanted to change the twig templates to utilise Tailwind. Followed the docs and everything is going well. In theme/templates/partials if I edit the base.html.twig template it shows up. However, if I edit the theme/templates/partials/navigation.html.twig file it does not show up.

I've set

TXT
cache: 
enabled:false

in the user/system.yaml file for cache and twig.

I'm missing something. Any ideas welcome. Thanks
Andy

3 years ago

@Gibney,

Followed the docs

Which docs? I'm not aware of any docs about Tailwind and Grav...

Since you haven't provided any code snippets, I can only test some bare tailwind themes created using plugin 'DevTools':

  • When I create a new 'tailwind' theme using $ bin/plugin devtools new-theme and set that theme as the current theme in /user/config/system.yaml, any change will be reflected in the resulting page.
  • When I create a new 'tailwind-mix' theme using $ bin/plugin devtools new-theme and set that theme as the current theme in /user/config/system.yaml, any change will be reflected in the resulting page.

No need to disable cache...

3 years ago Solution

Solved. The first part of the navigation files uses {% macro loop(page) %} (which I have no idea what it does. ) The second part outputs the navigation html. Edited that, now it's working.

3 years ago

@pamtbaau:
Which docs? I’m not aware of any docs about Tailwind and Grav…

You are right. By docs I meant following the creation of a new theme using the CLI

As you said, I chose the Tailwind option, which sets up the required folder structure.
Then I referenced the Typhoon docs which follows the Tailwind process to compile and watch your files.

There are probably better ways of doing this, and building off of Typhoon would be a great start, but I'm new to Grav and just trying to find my way.

last edited 08/24/23 by Andy Clark

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 85 13 hours ago
General · by pamtbaau, 18 hours ago
1 60 17 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 350 5 days ago
General · by Duc , 6 days ago
3 44 5 days ago