"directorylisting" want render correctly

Hi,
i´m new to GRAV and use Learn2 as Theme.
I want to show my files in a listform, so i tried “GitHub - OleVik/grav-plugin-directorylisting: Simple directory listing for pages in Grav.
But i get only a unformatted html-output.
After analyzing i found out that the problem is, that the output contains:
< > " etc.

<div id="Files">&lt;div class=&quot;directorylist&quot;&gt;&lt;ul class=&quot;metismenu metisFolder&quot;&gt;&lt;li class=&quot;directory active&quot;

If i replace them with ‘>’, ‘<’, etc. then the rendering is correct and i get a correct graphical output.
<div id="Files"><div class="directorylist"><ul class="metismenu metisFolder"><li class="directory active">
Correct:
image

Any ideas what´s wrong? Any settings to change?

Hi, @habreli and welcome,
use raw twig filter, in your case it would be
{{ directorylisting|raw }}

Thanks,
you are my hero. I spent many hours, but i could not find this.

1 Like

Thanks to a tip on the repository about this thread, I updated the README to include the raw-filter in the examples. Hopefully that makes it a bit more clearer, and hopefully Grav will someday return to a situation where that sanitization isn’t necessary.

2 Likes