Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.

Custom Stylesheets per page

This is a little gem that is not often used in BTS, but should be, is the ability to create per page stylesheets.

This is how you do it:

  • In whatever template you are using, simply create a new directory called stylesheets
  • In this new directory, add your new stylesheet with a filname in this format:
    • pagefilename.css
  • Replace pagefilename with whatever filename you want the new stlyes to load for.
    • So for example, I want a custom stylesheet to load for create_account.php, I simply need to make a new stylesheet in my /templates/<your template>/stylesheets directory called create_account.css.
  • Make sure this bit of code is in the head section of your main_page.tpl.php.

Replace this:

<?php if (bts_select('stylesheets', $PHP_SELF)) { // if a specific stylesheet exists for this page it will be loaded ?>
<link rel="stylesheet" type="text/css" href="<?php echo (bts_select('stylesheets', $PHP_SELF)); // BTSv1.5 ?>">

<?php } ?>
<link rel="stylesheet" type="text/css" href="<?php echo (bts_select('stylesheet','stylesheet.css')); // BTSv1.5 ?>">

With this:

<?php if (bts_select('stylesheets', $PHP_SELF)) { // if a specific stylesheet exists for this page it will be loaded ?>
<link rel="stylesheet" type="text/css" href="<?php echo (bts_select('stylesheets', $PHP_SELF)); // BTSv1.5 ?>">

<?php
} else { ?> 
<link rel="stylesheet" type="text/css" href="<?php echo (bts_select('stylesheet','stylesheet.css')); // BTSv1.5 ?>">
<?php  } ?>

  • Using this method this will allow each page of your shop to have its own custom styles.
  • Bookmark at
  • Bookmark "Custom Stylesheets per page" at Reddit
  • Bookmark "Custom Stylesheets per page" at Google
  • Bookmark "Custom Stylesheets per page" at Facebook
  • Bookmark "Custom Stylesheets per page" at Twitter
  • Bookmark "Custom Stylesheets per page" at Slashdot
custom_per_page_style_sheets.txt ยท Last modified: 2012/07/17 11:55 by michael_s
You are here: startcustom_per_page_style_sheets
Dieses Dokuwiki verwendet ein von Anymorphic Webdesign erstelltes Thema.
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0