I'm using a blog page type to list a bunch of pages, some of which are blog posts and some of which are other things (events, donation pages, etc). How do you get the blog page type to list something more than the headline for a subpage?
Official response from NationBuilder Support
Only pages with excerpts will show more than the headline when used as a subpage of a page outside of their structure.
For examples, events will show the content you expect when they are set as subpages of calendars. They will only show the headline when set as subpages of any other page type.
Share this post
Showing 9 reactions
Sign in with
Campaign Gears
Certified Architect
Thanks for your help. You provided what I needed.
I have now modified the template for the blog page type such that if the child page is a post it handles it like a post and if it’s something else (an event page or donation page) it presents the headline and excerpt. Not perfect but better than the previous behavior of just displaying the headline and nothing else.
I understand that the documentation can’t handle every possible scenario (no documentation can really) but I figured that’s what the support section is for? I still only see one reference to “page.children” in the documentation and it’s a four word sentence. Not exactly verbose.
But as I said, you gave me what I needed and it’s working now. Thank you.
If so, you can display that content in a forloop like this:
{ % for child in page.children % }
{{ child.headline }}
{ % endfor % }
This will, for example, output the headline for every single child under the parent.
Just as a side note, the documentation is definitely not intended to account for every imaginable scenario folks may encounter, but the different variables and syntax are there to help you put them together.
As Ian mentioned, if you need additional help with this we recommend getting in touch with a certified Architect.
Thanks.
Campaign Gears
Certified Architect
Yes, I have read the documentation, but I haven’t found the specific instructions on how to pull content from all the children of a page. I can pull the content if I specify a slug but I want to code to pull all the content dynamically.
Can you please point me to where in the documentation I would find a reference to doing that?
Hines Digital
Certified Architect
Certified Expert
If you have, and you’re still having difficulty, please consider contacting one of our certified NationBuilder Architects: http://nationbuilder.com/architects
Campaign Gears
Certified Architect
I have put in a basic file type template this code:
{ for child in page.pages }
{ subpage child with “showcontent” }
{ endfor }
(I have the % in all the right places in the code, I just left them out here to avoid conflict with the comment editor)
But I get this error:
Liquid syntax error: Error in tag ‘subpage’ – No such page slug child
How do I pass subpage varible inside the for loop?
Campaign Gears
Certified Architect