Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

How to get the content of a flex object unescaped

twig

Started by complanar 16 hours ago · 0 replies · 22 views
16 hours ago

I have a simple flex object and one of its properties named title contains an ampersand sign &. When I access those property in twig I always get it escaped as &even when using the |raw filter.

Example {{ object.title|raw }} renders to Foo & Bar if the content of the yaml file is title: Foo & Bar (with a literal unescaped ampersand). When I use {{ object.getProperty('title') }} in twig this comes out the same.

This may be acceptable when rendering as html but i want to output some events as ics file and want to preserve the original input.

Is there something I am missing?

Suggested topics

Topic Participants Replies Views Activity
Support · by Rick Beebe, 18 hours ago
0 20 18 hours ago
Support · by Marcel, 6 days ago
0 99 6 days ago
Support · by JakobDB, 1 week ago
1 99 7 days ago
Support · by ramenos, 1 week ago
3 114 7 days ago
Support · by gravinator, 2 weeks ago
3 236 1 week ago