I've followed directions for how to include content from one page on another with a tag here:
http://nationbuilder.com/theme_documentation#display_content_from_pages_with_a_certain_tag_on_another_page
However, when I try to replace {% for post in tag.most_recent_published_pages limit: 5 %} with any other page type (i.e. upcoming_event_pages or most_recent_petition_pages) it doesn't give me any love!
You shouldn't need to replace most_recent_published_pages, as that is a catch-all for every type of page. For example, if you have a blog post page and a petition page both with the tag "california", both will show up. If you are intentionally trying to have only one specific page type show up, or are trying to style various page types differently, you can do that using conditional statements within the for loop (see type_name here).
Showing 6 reactions
Sign in with
I know that 1) could still be done using conditional statements, but the next three upcoming events might only come up in the top 50 most recent posts. It would be incredibly inefficient to cycle through every post just to check whether it is an event and whether it is in the future, and then to sort that list by event date.
{% for post in tag.most_recent_published_pages limit: 5 }
{ case post.type_name }
{ when ‘Petition’ }
{{ post.headline }}
{ endcase }
{ endfor %}
For debugging purposes, you can see what the type_name is by adding {{ post.type_name }} in the loop. That will print the type_name of every result.
Check by cStreet - Mobile event check-in for organizers
Certified Architect
Certified Developer
{% for post in tag.most_recent_published_pages limit: 5 }
{ if post.type_slug == “event” }
{{ post.headline }}
{ endif }
{ endfor %}
Check by cStreet - Mobile event check-in for organizers
Certified Architect
Certified Developer
Check by cStreet - Mobile event check-in for organizers
Certified Architect
Certified Developer