Is there any easy way to output todays date on a page?
I am still new to Grav. It would be easy to just do it via custom PHP, but as far as I understood, I can't just insert php into a page? Why is that?
Community guidelines
Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.
Support
https://twig.symfony.com/doc/2.x/filters/date.html
{{ "now"|date("m/d/Y") }}
Thanks for your answer.
I just have to insert this as page content? I tried it, but it doesn't show the date, but just shows up as the same source code.
https://learn.getgrav.org/16/cookbook/twig-recipes
when using within pages make sure you add following configuration to the page header:
YAML
twig_first: true
process:
twig: true
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 2 | 51 | 8 hours ago | ||
| 2 | 58 | 10 hours ago | ||
| 1 | 30 | 11 hours ago | ||
| 2 | 63 | 5 days ago | ||
| 2 | 55 | 5 days ago |