Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

Unpublished blog shows children articles

Started by Pedro M 2 years ago · 0 replies · 286 views
2 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 jean-louis67, 3 days ago
2 80 2 days ago
General · by Andy Miller, 6 days ago
0 144 6 days ago
General · by Veehem, 1 week ago
0 144 1 week ago
General · by milkboy, 1 week ago
0 138 1 week ago
General · by ian russell, 2 weeks ago
2 226 2 weeks ago