Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Additional Markdown

Started by Muut Archive 10 years ago · 3 replies · 354 views
10 years ago

Is it possible to add additional markdown to a .md file? I see that there is a plugin, but that uses a completely different file extension it seems, and is clearly incompatible with the admin plugin. Basically, I want to have a summary markdown area and a content markdown area. The summary will be shown on the parent page, and the content will be shown when the user clicks through. Cheers.

10 years ago

Grav supports the === for breaking between summary and rest of content. As it happens, I just wrote this in a reply to another post, so for example the .md content:

TXT
Introduction, for example a paragraph or two.

===

Rest of content, several paragraphs.

And in twig, I use:

TWIG
{{ page.summary }}
{% include "forms/form.html.twig" %}
{{ page.content|slice(page.summary|length) }}

So you could just loop over child-pages and only access the summary.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1354 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4065 9 years ago
Archive · by Muut Archive, 9 years ago
1 2953 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago