Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Cascading Style sheets, themes, media and alternative style sheets


Go to End


10 Posts   4834 Views

Avatar
KatB

Community Member, 105 Posts

22 February 2008 at 6:10pm

What is the smartest way to include a special style sheet that is only in existence for one page and is quite large?

I have tried to over-ride the init function for that page type in its controller:

class Widget_Controller extends Page_Controller {

   function init() {
      parent::init();
      Requirements::themedCSS("widgets.css");
   }
}

but to no avail. Should this work?

Avatar
Design City

38 Posts

19 March 2008 at 8:47pm

willr: I don't use it often but I have used it before. Adding a title to a css sheet enables you to have alternative style sheets set up in the document that have to be 'selected'. This lets you do reasonably useless things like switching themes, and reasonably useful things like having alternative high contrast stylesheet for users with impaired vision, or an alternative stylesheet with a larger font size etc.

We use them on our corporate site (http://designcity.com.au/) to increase the font size.

Go to Top