Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Unpublished blog shows children articles

Started by Pedro M 3 years ago · 0 replies · 340 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 jeremycherfas, 1 week ago
4 182 2 days ago
General · by lynbor, 6 days ago
2 124 3 days ago
General · by Old Man Umby, 1 week ago
1 100 1 week ago
General · by Sebastian, 2 weeks ago
1 124 2 weeks ago
General · by Andy Miller, 3 weeks ago
0 248 3 weeks ago