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

Using Smarty to do the math in your stylesheet

This recipe shows you how you can use Smarty to compute sizes in your stylesheet. By setting a few key sizes and computing other dimensions from those values, we make it much easier to change the layout of a site while preserving the proportions.

Getting ready

For this recipe, you will need login access to the site's Administration area as a member of the "Admin" group or as a member of a group with a fair number of permissions: "Add Stylesheets", "Add Stylesheet Associations", and "Manage All Content".

How to do it...

  • Log in to your CMS Administration area.
  • Using the top menu, go to "Layout" and click on "Stylesheets".
  • Click on the "Add a Stylesheet" button.
  • Enter "width_calculator" into the"Name" field. ...

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