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 · 4016 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 1280 9 years ago
Archive · by Muut Archive, 9 years ago
2 888 9 years ago
Archive · by Muut Archive, 9 years ago
1 2892 9 years ago
Archive · by Muut Archive, 9 years ago
3 1076 9 years ago
Archive · by Muut Archive, 9 years ago
3 6555 9 years ago