Is there a way in Grav/Twig to know you're looking at a blog post in a list. (In order to show different content in teaser than in detail page - eg. show pictures/media only on detail page, not on list page)
Archive
Well you have a few options. You can use a different twig template to render the item in the list and on it's own. Then in each template you can render things differently, or add a css class or something, to display things differently via css alone.
You could pass a variable into the twig include that tells the template if it's a list or a detailed view.
Alternatively you could have a header setting on the page with a 'summary or headline' or something that you use on the list view, then simply show the full content on the details view.
Log in to reply.
Suggested topics
| Topic | Participants | Replies | Views | Activity |
|---|---|---|---|---|
| 0 | 1332 | 9 years ago | ||
| 2 | 923 | 9 years ago | ||
| 2 | 4053 | 9 years ago | ||
| 1 | 2931 | 9 years ago | ||
| 3 | 1109 | 9 years ago |