You are here

How to move the position of the featured content slider

Submitted by Will on April 26, 2012 - 6:55pm

In NationBuilder, almost every page has an option to add a slider at the top which features images and links. These content sliders are nice and easy to set up through the Settings>Featured Content Slider tab on the page.

Unfortunately, they can be rather difficult to customize beyond the content you include, including where on the page it's placed.

Luckily, though, my colleague, Padma, told me how to move it on the template level:

To move the position of the featured slides on a given page, you must do these two things.

  1. Normally this code: {% include "features" %} lives in the "columns_1.html" and "columns_2.html" files, and this is what displays the featured slides on the page.

    If you want to move the location of the slides on a given page, or pages, put this code in place of the original {% include "features" %} in the columns_1.html and columns_.html template files.

    1.     {% case page.id %}
    2.       {% when 46 %} {% comment %} replace "46" with the page id of the page you are editing {% endcomment %}
    3.          {% comment %} do nothing {% endcomment %}
    4.       {% else %}
    5.         {% include "features" %}
    6.     {% endcase %}
  2. Put this code inside of the single page template of the page you want to move the slideshow on. Put it wherever you want the slide to appear.

    1.     {% case page.id %}
    2.       {% when 46 %} {% comment %} replace "46" with the page id of the page you are editing {% endcomment %}
    3.     {% include "features" %}
    4.       {% else %}
    5.         {% comment %} features moved only for homepage {% endcomment %}
    6.     {% endcase %}