cms_stylesheet tag


A replacement for the {stylesheet} tag, this tag provides caching of css files by generating static files in the tmp/cache directory, and smarty processing of the individual stylesheets.

This plugin retrieves stylesheet information from the system. By default, it grabs all of the stylesheets attached to the current template in the order specified by the designer, and combines them into a single stylesheet tag.

Generated stylesheets are uniquely named according to the last modification date in the database, and are only generated if a stylesheet has changed.

   How to use?

Just insert the tag into your template/page's head section like:


   Available parameters

  • name - Instead of getting all stylesheets for the given page, it will only get one specifically named one, whether it's attached to the current template or not.
  • nocombine - If set to a non zero value, and there are multiple stylesheets associated with the template, the stylesheets will be output as separate tags rather than combined into a single tag.
  • nolinks - Used to output only href to Stylesheet file instead of full tag. This is useful if you want to use @import in your Stylesheet or customize the inclusion of Styles in your Template.
  • https - (boolean) indicates wether the ssl_url config entry should be used to prefix stylesheet urls. If not specified, the system will attempt to determine the proper root url based on the secure flag of the page being displayed.
  • templateid - If templateid is defined, this will return stylesheets associated with that template instead of the current one.
  • media - When used in conjunction with the name parameter this parameter will allow you to override the media type for that stylesheet. When used in conjunction with the templateid parameter, the media parameter will only output stylesheet tags for those stylesheets that are marked as compatible with the specified media type.

   Syntax examples

{cms_stylesheet name="IE"}

   Smarty Processing

This section has been moved to the Stylesheets page.

   Using Media Queries

This section has been moved to the Stylesheets page.