# Creating Content Blocks
Content blocks are used to create bold sections of content on any page. They are simply snippets of other pages, which are imported into another page. Once created, they will appear after a page's standard content.
To add a content block, you need to add a tag to a page using this format:
~add-block-[number]=[slug]
Where;
number
- refers to the order of the particular block.slug
- refers to the slug of the page which will be used to populate the block.
For example, to add a content block that previews your blog, the tag may look like so:
~add-block-0=blog
Once you add several content blocks to a page, the 'Tags' field will look something like this:
TIP
If you find that these tags are not being placed in the order you require, delete the tags from your site and add them again (ensure they aren't being used anywhere else). To do this, from your site's admin area, go to More > Tags and delete each tag.
Click here (opens new window) to see examples of a page with multiple content blocks.
# Alternating Alignment of Images/Forms in Content Blocks
In each content block, the the main content item (either an image, form, or other) will be aligned to either the left or the right of the content block. This placement alternates for each content block down the page (i.e. left, right, left, right, etc).
# Adding Content Blocks with the 'Homepage' Tag
A simple way to add content blocks to the home page is to add the homepage
tag to all the source pages you wish to add. All pages with the homepage
will be added as content blocks on the home page, ordered by the date they were published.
# Customising the Block Background Color
The are two alternative background colors you can apply to a content block. To do this, add one of the follow tags to the source page of the content block:
~block-setting=background-color-secondary
~block-setting=background-color-primary
The color that will be applied will be determined by your theme variation, or any custom styles.
Click here (opens new window) to see an example.
# Adding a Background Image to a Block
To add a background image to a content block, add the ~block-setting=background-image
tag to the source page of the content block. The source page must have 1 featured image added to it, which will be used for the background.
Click here (opens new window) to see an example.
TIP
Experiment with using a semitransparent background image with a background color for the content block. The image will be tinted with the relevant color.
# Display all Content in a Content Block
By default, most content blocks will display a truncated version of the source page's main content, followed by a read more → link. In some circumstances you may want to display all of the source page's content in the content block. To achieve this, add the tag ~block-setting=show-all-content
to the source page.
# Adding a Testimonials Content Block
To create a testimonials content block, first add the ~block-setting=testimonials
tag to the intended source page.
Testimonials are created using the featured content slider. From the content block's source page editing area, navigate to Settings > Featured content slider.
For each testimonial add a slide with the details as;
- Label - The name of the person giving the testimonial.
- Headline / Action text - The given testimonial text.
- Page to feature - This can be anything since it won't be used (although NationBuilder requires this field). For simplicity, just set it to the slug of your home page.
- Image - Add a square image of the person giving the testimonial.
WARNING
For consistent styling across each testimonial, the image must be square.
Click here (opens new window) to see an example.