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 | 46 | 8 hours ago | ||
| 4 | 227 | 2 days ago | ||
| 13 | 275 | 5 days ago | ||
| 9 | 334 | 1 week ago | ||
| 4 | 187 | 2 weeks ago |