You are here

NationBuilder How To: Displaying a List of Recently Added Content

Submitted by Kate on September 14, 2011 - 12:18pm

Updated 2012-01-29.

NationBuilder can provide a display of content recently added to your nation. This is a great resource for visitors to get a feel for what is on the site, and can be used in a page or sidebar (my example is on a page). Let's get started!

Display Recent Pages

This lists all recent content, including petitions, donation pages, etc.

    {% for recent_page in site.most_recent_pages %}

  • {{ recent_page.icon | icon }} {{ recent_page.title }}
  • {% endfor %}

Display Recent Petitions

    {% for recent_page in site.most_recent_petition_pages %}

  • {{ recent_page.icon | icon }} {{ recent_page.title }}
  • {% endfor %}

You can get rid of the icons, but I think they're helpful for letting folks know what kind of content is in the Recent Pages display. Post a link to your site in the comments if you use this trick, and (as always) shoot us an email if you need help!