O'Reilly logo

CMS Made Simple Development Cookbook by Samuel Goldstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Making a variable available to Smarty

Sometimes you will have tag-generated content that you want to show in multiple areas on a page, or that you will want to manipulate in some way, or even use the value in some kind of conditional logic. Instead of having your tag display its output directly in the template, you can have it set a Smarty variable.

This recipe demonstrates getting a reference to the Smarty engine within a User-Defined Tag, and exporting variables for use in Smarty.

Getting ready

For this recipe, you will need login access to your site's Administration area with permission to "Modify User-Defined Tags", "Modify Templates", and "Manage All Content".

How to do it...

  1. Log in to your CMS Administration area.
  2. Using the top menu, go to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required