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.

Plugins

"directorylisting" want render correctly

Solved by Vadym View solution

Started by Hans Breitenfellner 2 years ago · 3 replies · 79 views
2 years ago

Hi,
i´m new to GRAV and use Learn2 as Theme.
I want to show my files in a listform, so i tried "https://github.com/olevik/grav-plugin-directorylisting"
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|260x101

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

2 years ago Solution

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

2 years ago

@b.da:
{{ directorylisting|raw }}

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

👍 1
2 years ago

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

Suggested topics

Topic Participants Replies Views Activity
Plugins · by Rene, 1 week ago
2 44 1 week ago
Plugins · by Xavier, 4 weeks ago
2 54 4 weeks ago
Plugins · by Luka Prinčič, 7 years ago
3 1181 1 month ago
Plugins · by Sebastian van de Meer, 1 month ago
1 48 1 month ago
Plugins · by PIERROT Alain, 2 months ago
3 73 2 months ago