Retired Documentation:  You are using the documentation for version 1.7.3 which was retired in 2013. Go here for the latest version documentation or check here for your available upgrades to the latest version.

Linking to Stylesheets

Stylesheet Global Variable

The stylesheet global variable is meant for generating URLs for use when linking to stylesheets. The basic syntax is this:

{stylesheet=template_group/css_template}

Make sure you substitute "template_group" and "css_template" with the name of your actual template group and CSS template.

The stylesheet variables is used exclusively in the CSS declaration in your pages. It must contain the template group/template name where your stylesheet is located:

<link rel="stylesheet" type="text/css" media="all" href="{stylesheet=weblog/weblog_css}" />

In many respects, this variable works much like the {path=''} global variable. However, there are some special considerations for the stylesheet variable:

Triggering a Stylesheet Via the URL

It is also possible to point to a stylesheet templates by directly adding a "css" trigger word in the URL. For instance, if your stylesheet is the "weblog_css" Template of the "weblog" Template Group, you could point to it using the URL:

http://example.com/index.php/css/weblog/weblog_css/

Using Tags and PHP in a Stylesheet

Additionally, you can allow your stylesheets to run through the full template parser so tags and PHP can be used. To do so, just use a normal path variable to access your stylesheet. If you specify a template this way make sure that it is set to "CSS Stylesheet" as the Template Type.

Top of Page