Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Unpublished blog shows children articles

Started by Pedro M 3 years ago · 0 replies · 389 views
3 years ago

I'm working on a personal page to which I want to add a blog section, with some articles, but I want to leave that section disabled for now. If I unpublish the blog page, I can still access the child pages (item type)

Is there a way to prevent the child pages of a collection from being accessible if the parent page is unpublished?

To avoid seeing some modular parts of the home page, as latest posts has been simple:

TWIG
{% if blog.published %}
{% include 'partials/sidebar/latestposts.html.twig' with {'blog': blog } %}
{% endif %}

But I don't know if I should do the same in the item.html.twig template or is there some different way.

Suggested topics

Topic Participants Replies Views Activity
General · by Andy Miller, 1 week ago
0 120 1 week ago
General · by lynbor, 1 month ago
3 446 2 weeks ago
General · by lynbor, 3 weeks ago
7 572 2 weeks ago
General · by Harry, 2 weeks ago
0 166 2 weeks ago
General · by Old Man Umby, 1 month ago
2 311 4 weeks ago