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.

Archive

There is a way to do a "if condition" in MD page?

Started by Muut Archive 9 years ago · 2 replies · 4014 views
9 years ago

Hi,
Is there a way to add content only if a condition is verified?
For example something like that

If <condition> then
Show this content
else
Shows this other
endif

Thanks,
Andrea

9 years ago

No, Markdown is pure text with simple formatting. You can do this in Twig through {% if var %} etc, and you can incorporate this Twig within Markdown-content by enabling it in the page's FrontMatter.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1277 9 years ago
Archive · by Muut Archive, 9 years ago
2 885 9 years ago
Archive · by Muut Archive, 9 years ago
1 2891 9 years ago
Archive · by Muut Archive, 9 years ago
3 1074 9 years ago
Archive · by Muut Archive, 9 years ago
3 6553 9 years ago