Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Twig href value inside a block not parsed

Started by Seb 9 years ago · 1 replies · 1168 views
9 years ago

Hi, some news about this bug, in archive but still alive?

/forum/archive/twig-variable-as-link-t6829

A summary as of today:

Inside a markdown file, set active both markdown and twig process,

Add this

<div><a href="{{ mylink }}">click me!</a></div>

See how the href is not parsed...

But move your 'a' outside your 'div' and it works!

Thanks everybody!

9 years ago

Should be an easy fix, you should add a filter,

HTML
<div><a href="{{ mylink }}">click me!</a></div>

should become

HTML
<div><a href="{{ mylink | raw }}">click me!</a></div>

Hope it helps :)

Suggested topics

Topic Participants Replies Views Activity
Content & Markdown · by Jochen, 11 months ago
6 1200 11 months ago
Content & Markdown · by Ton Haarmans, 1 year ago
10 964 1 year ago
Content & Markdown · by Jan L'Am, 2 years ago
4 844 2 years ago
Content & Markdown · by Leonardo, 2 years ago
3 766 2 years ago
Content & Markdown · by belthasar, 2 years ago
4 1180 2 years ago