Stylesheet Example


Conditional Variables

If you look at the layout used generate this "site" you'll see this:

  <!-- tmpl_if name='stylesheet' -->
   <link rel="stylesheet" href="<!-- tmpl_var name='stylesheet' -->"
      type="text/css" />
  <!-- tmpl_else -->
   <link rel="stylesheet" href="style.css" type="text/css" />
  <!-- /tmpl_if -->

Here the code basically says:

  • If there is a variable called "stylesheet" set then use it.
  • Otherwise include the "style.css" link.

If you guessed you could then set a per-page stylesheet-variable you'd be correct.

This page contains a link to one:

title: Stylesheet Example
stylesheet: dark.css

Show the source of this page.