I am trying to add a photo gallery to a site using a method that employs .php files and javascript. I don't see anywhere to upload .php files to use them on the site or to use them as the main page in the site's layout. How do I use .php files with Nationbuilder? Alternatively, what would be the best way to create a on the site that uses Flickr or some other photo-sharing website as the source?
Official response from Jeff Dunne
Hey Keith, we support PHP via our API, but not natively on our websites. The workaround you outlined (in the comments) using JQuery is great, and the FancyBox/Liquid suggestion that Zach posted is also a perfect way to display a photo gallery.
Share this post
Showing 15 reactions
Sign in with
If you are not seeing a tab called “New File” when you click on Websites – Theme, you are likely using either a stock theme or a custom theme that is owned by someone else and is shared to you in a way that prevents you from editing it. To learn about creating your own custom theme, check out this page: http://nationbuilder.com/theme_documentation
If you are still having trouble with this, please shoot us an email at [email protected].
There is no “New File” option when I go to Website > Theme
{% for page in tag.most_recent_published_pages_no_pagination }
<a href=“%7B%7B%20page.attachments.first.url%20%7D%7D” class=“swipebox” title=“{{ page.headline }}”><img src=“%7B%7B%20page.attachments.first.url%20%7D%7D” height=“200” width=“200”></a>
{ endfor }
then trigger your javascript, the above uses swipebox which is a nice mobile plugin. http://brutaldesign.github.io/swipebox/
which pulls the first file from all pages with a certain tag. i.e
{ tag “imagegallery” with “gallery” %}
NationBuilder employee
I’ve already started to implement it on my site, here’s a working example:
http://straubcreativeco.nationbuilder.com/graphic_design
Happy coding!
One example is: massyrs.nationbuilder.com This page has the pictures coming in and just being shown at the bottom of the page.
The other example is at: massyrs.nationbuilder.com/events This page has the animation option in the parameters so, it displays the pictures in an infinite slider.
The link is here for the jQuery Lightbox thread: http://nationbuilder.com/digchau/jquery_lightbox_plugin_not_working
Also, in regard to this thread, a NB user was able to get the tried and true
plugin to work on his site, but there’s no documentation. I spent a few hours on it last night and couldn’t get the thing to turn on!