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:
template └─css └─img └─js └─layout.php
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> <html> <head> <title><?php echo $page_title; ?></title> <meta name="description" content="<?php echo $page_desc; ?>"> <link rel="stylesheet" href="<?php echo $path; ?>/template/css/base.css"> </head> <body> <?php echo $parsedown->text($content); ?> </body> </html>
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.
As of Pulse 4.1, 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:
template └─alternate └─css └─img └─js └─layout.php
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.
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 four 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 the theme-o-matic
Try the Pulse CMS theme maker. From web builder app to Pulse template. Go from Freeway, Blocs app, RapidWeaver, Pinegrow (or any HTML template code) to a Pulse theme in seconds.
3. 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.
4. 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.