How to template

Pulse CMS uses a centrally located template system to render all pages. You can use the default theme,  download other pre-made themes or import your own design. The theme files are located in the 'template' folder, with the following folder structure:


The layout.php file contains the main structure of the template while the css, js, and img folders have the supporting files. Essentially, the layout.php file is just a simple HTML page with a few special tags that pull in the content from Pulse.

Below is an example of a template in its most simple form. As you can see it is just a regular html page with three PHP snippets for pulling in the title, description and content.

<!DOCTYPE html lang="<?php echo \pulsecore\language_to_iso(\pulsecore\wedge\config\get_json_configs()->json->language); ?>">

	<title><?php echo $page_title; ?></title>
	<meta name="description" content="<?php echo $page_desc; ?>"><br>	<br>	

<?php echo \pulsecore\get_context()->theme->meta->render(); ?>
<br>	<br>	<link rel="stylesheet" href="<?php echo $path; ?>/pulsecore/asset/css/pulsecore.css">
	<!-- GOOGLE ANALYTICS &mdash;>
   <body <?php echo \pulsecore\get_context()->theme->body_tag->render(array('')); ?> >

	<br>	{{navigation_logged_in}}
<br>	<?php echo (isset($parsedown) ? $parsedown->text($content) : $content); ?>
	<br>	<?php echo \pulsecore\get_context()->theme->made_in_pulse->render( array('badge_image' => (\pulsecore\wedge\config\get_json_configs()->json->path . '/content/media/branding/logo.svg')) ); ?>
	<!-- Stats Tracking Code -->
	<?php $http_referrer = (empty($_SERVER['HTTP_REFERER']) ? 'none' : $_SERVER['HTTP_REFERER']); ?>
	<script src="<?php echo $path; ?>/<?php echo $admin; ?>/inc/tracker.php?uri=<?php echo $_SERVER['REQUEST_URI']; ?>&ref=<?php echo $http_referrer; ?>"></script>

So if you already have a template design you would like to use, you just need to copy it into layout.php and then place those three PHP snippets.

Multiple Templates

With Pulse you can now have multiple templates on the same site. For example, if you have a page or group of pages you wish to have a different template from the rest of the site, you can use a secondary template.

The base template is stored in the 'template" folder. To create a secondary template, just add a sub-folder within the 'template' folder and place a new 'layout.php' file inside along with any supporting css or js file it uses.

If you created a new template called 'alternate' the folder structure would look like this:


To use this alternate template on a page, just add the following tag at the top of your page:


There is no limit to the number of templates you can use and you can name them anything you like. You can also set this in the page META drawer.

Adding Blocks to Templates

There are some occasions when you would like to add Blocks to template pages. For example, if you would like a Block to appear on every page, such as with a navigation, a footer or a sidebar. If you would like to embed a Block in your template.php use the following:

<?php include("content/blocks/sb_nav.txt"); ?>

Change the "sb_nav.txt" to the name of the Block you want to include.

Adding Pulse Tags to Templates

As with Blocks above, there may be cases when you would like to embed Pulse Tags in your template pages. For example, if you have a Slider you would like to appear before the main body content on every page or a Pulse Gallery. To do so, use the following:

<?php $tag_var1="gallery1"; include('inc/tags/slide.php'); ?>

Change the "gallery1" to the name of the gallery of images to use in the slider. And change the "slide.php" to "gal.php" to embed a gallery of images instead.

There are several ways to theme for Pulse:

1. DIY Method

Check the  doc and video above. Use any HTML5 / PHP framework (Foundation, Bootstrap) and convert your own site template in minutes. Easy for designers and developers to work with.

2. Use Pulse Builder for Mac and PC

Drag and drop your way to a beautiful Pulse site, without coding at all. Add blocks, fine tune with components and build gorgeous Pulse sites in minutes. Export as a Pulse template and upload to your Pulse site and let your customers loose on it. Read more about the  Free Builder.

3. Use RapidWeaver for Mac

Redesigned and Reengineered For RapidWeaver Designers. Full Pulse5 integration and all you need to make your Weavered sites editable from any browser. Read more about the Pulse+RapidWeaver.

4. Use Blocs for Mac

Get started and working together with this great workflow. Design in Blocs for Mac and clients can edit online with Pulse. No coding needed.  Read more about the Pulse+Blocs app.

5. Get a theme

Download a free or premium theme from the community. Browse the growing  addons section, download and add to your Pulse install. Takes minutes and easy for anyone. Supported by the community.

6. Call Pulse Professionals

If you need some theme porting help, want something in particular or need a larger Pulse theme customisation, then contact us and we'll connect you with a local Pulse Professional to help you. They're always there for you.  Post on the forums what you are looking for and someone can offer their services for hire.

Still need help? Contact Us Contact Us