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?
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 |
|---|---|---|---|---|
| 1 | 120 | 2 days ago | ||
| 5 | 194 | 2 days ago | ||
| 0 | 44 | 2 days ago | ||
| 0 | 43 | 3 days ago | ||
| 3 | 92 | 3 days ago |