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.

Content & Markdown

Markdown on Modular Pages

Solved by Birger Krägelin View solution

Started by Birger Krägelin 5 years ago · 8 replies · 980 views
5 years ago

does not work as expected. I created modular pages from example, but markdown gets rendered as pure text only.

Changing {{ content|raw }} to {{ content|markdown }} in modular/text.html.twig does resolve the problem. (Using Antimatter as well as Quark as my theme.)

What's wrong? Any suggestions?

Thanks, Birger

5 years ago

@bkraegelin, No idea what is going wrong and I cannot reproduce it either...

Have you tried to download 'One-Page Site'Skeleton and compare it with your efforts?

5 years ago

I just copied /user/pages/01.home to my server as /user/pages/06.onepageskeleton.

Besides error "modular/hero.html.twig template not found for page: /onepageskeleton/_hero" I can see the content. The content isn't rendered with Markdown, I get text "# Why Grav? ## build sites better We believe the best recipe to make something great, is to bake with quality ingredients and add dollops of cool stuff.".

The same is true with Antimatter and Quark theme.
Even if I disable my own plugin, it's always the same.

Any suggestion, where I should look for inconsistencies?

Thanks,
Birger

5 years ago

@bkraegelin,

Besides error “modular/hero.html.twig template not found for page: /onepageskeleton/_hero”

The 'One-Page Site' skeleton is build for theme Quark, which provides template modular/hero.html.twig. Themes are not one-on-one exchangeable, e.g. Antimatter does not provide template modular/hero.html.twig.

The same is true with Antimatter and Quark theme.

That is odd, because theme Quark does provide template modular/hero.html.twig and should not throw an error.

Questions:

  • What is the value for pages.process.markdown in system.yaml?
  • Have you run the skeleton on your server? Does it work?
  • Do templates other then 'hero' render correctly?
  • How did you install Grav on your server?
  • Have you tried a fresh install of Grav?
last edited 03/03/21 by pamtbaau
5 years ago

Thanks. I will do a complete reinstall from scratch and do intensive testing. These will need some time 😦

I was hoping to get some hints, to find the inconsistency without going the hard way.

Birger

5 years ago

@bkraegelin, My questions are meant to narrow down the location of the issue... These might be seen as a hints ;-)

The 'hard way' is only mentioned as last resort.

5 years ago

Found:
System configuration Process Twig First
I have also set Process frontmatter Twig, I need that for my plugin.

I have now to check, how to handle Twig/Markdown-processing correctly in my plugin.

Thanks for your help,
Birger

5 years ago

@bkraegelin, I'm afraid future readers will not quite understand how your solved the issue. Would you mind being a tad more explicit in which config file, what the settings were and how you have changed them in order to solve the issue?

Thanks!

5 years ago Solution

The issue was caused by setting the config setting pages.twig_first to true.
Reverting the setting back to its default value false solved the issue.

This setting can be found in Admin, path /admin/config, as System-->Content-->Process Twig First.

Or, alternatively, in /user/config/system.yaml:

YAML
pages:
  twig_first: false|true    # Process Twig before markdown when processing both on a page
last edited 03/03/21 by pamtbaau

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 8 months ago
6 96 8 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 184 1 year ago
Content & Markdown · by Jan L'Am, 1 year ago
4 147 1 year ago
Content & Markdown · by Leonardo, 1 year ago
3 61 1 year ago
Content & Markdown · by belthasar, 1 year ago
4 255 1 year ago