Pulse Tags / Blocks
Pulse Tags are a new feature introduced since Pulse 4.0. They make it easy to embed features such as the blog, blocks, galleries, form, etc. Instead of using PHP includes with breakable paths, Pulse Tags are much easier to use and cannot be broken by a bad path. Here is a few examples of how tags work:
To place the blog on a page:
To place the block on a page:
To create a gallery on a page:
To place the form on a page:
To place the newsletter signup on a page:
To embed your Just Forms form on a page:
Not only does Pulse come with a set of default tags, but you can create your own. This is a really powerful feature that also very easy to use. You can think of these like plugins as they allow you to create new embedable features in Pulse.
For example, let's say you have a small PHP script that displays a random image each time the page loads. Just paste the code into a new file called 'rand.php' in the 'inc/tags' folder. Now you can call this script into any page or block simply by typing:
So that is a very simple example of creating a custom tag. But in some cases you will need more than just that. Let's say that in the example above, you want to call the images from one of the gallery folders in Pulse. The embed code does not have enough information in it to specify any addional information. This is where tag variables come into play. With tag variables your embed code can be written as:
Pulse will read the tag and automatically convert the 'gallery3' portion of the tag and put it into a variable called '$tag_var1'. Now your script can look for '$tag_var1" on load so it knows where to pull the images from.
Each Pulse Tag can include up to 3 variables. If your script uses all three the syntax would look like this:
This would set:
$tag_var1 = 'gallery3';<br>$tag_var2 = 'med';<br>$tag_var3 = '10';