How to use global content blocks in CMS Made Simple

Global content blocks are chunks of content or HTML that are called by global_content tags in your templates. For example, instead of writing footer content in each template, you can create a footer template and use a global_content tag that calls and displays the footer template content. Using this method of adding content reduces effort and errors. It also makes updating content easier because you make the changes once in the global content block instead of in each template.

Setting up global content blocks

There are two steps to setting up global content blocks – creating the global content block template and adding the global_content tag to the page template.

In this example, we’re adding a global content block that contains a More information section which will be displayed at the bottom of every page that uses the specified page templates. This is what a page using the Left simple navigation + 1 column default template looks like before adding the global content block:

Create the global content block template

Log in to your CMS Made Simple admin panel and click Design Manager in the CMS > Layout section.

On the Templates tab, click Create a new Template. In Template Type, select Core::Generic and click Submit.

Enter a Name for the template. Our example is called MoreInfo. In Template Content, delete the default text and add the following code:

<h2>More information</h2><br />
<p>For more information, contact us by email or phone.<p>

The first line displays More information formatted as a second-level heading, then a line break. The second line displays another line of content formatted as paragraph text.

Click Description and add a description of the template. The description is optional but recommended, especially if you create many templates or have multiple authors and designers working on your site.

Click Designs and select the designs that you want to use. Hold down the Ctrl key to select multiple designs. In most cases, you don’t need to change the settings on the Advanced or Permissions tabs. Click Submit.

Add the global content block to the page template

Now you need to add the global content block to a page template. In this example, we’re adding the MoreInfo global content block to the Left simple navigation + 1 column default template, which is a Core::Page template type.

In Template Content, find the Content Area section and add the global_content code at the bottom:

 {global_content name='MoreInfo'}
<br />

The Content Area should now look like this:

Click Apply. Reload the page of content that uses the Left simple navigation + 1 column default template. The More information section should now be displayed below the page content.

More information

For more information about the global_content tag, or other CMS Made Simple tags, go to Extensions > Tags in the CMS Made Simple admin panel and click the tag name to display help.

For general information about CMS Made Simple, see What is CMS Made Simple and How to install CMS Made Simple in the HostPapa knowledge base.

If you have any questions or need help, you can always contact HostPapa Support by opening a support ticket.

Related Articles

Get online with our affordable web hosting

Get online with our affordable web hosting

Learn more now
HostPapa Mustache