I have a site that has two different blogs: Stories and News. On the single posts page, I want to be able to check if the parent of the post is the News page so I can display some additional content. I thought one of the conditionals below might work, but having no luck. Any help?
{% if page.parent.slug == 'news' %}
{% if post.parent.slug == 'news' %}
Official response from NationBuilder Support
Blog posts are referred to as "post" on the Blog page-type, but on the individual blog posts they're a "page." Therefore, the code you're looking for is:
{% if page.parent.slug == 'news' %}
conditional code goes here
{% else %}
alternative code goes here
{% endif %}
Share this post
Showing 6 reactions
Sign in with
Hines Digital
Certified Architect
Certified Expert
Hines Digital
Certified Architect
Certified Expert