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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

How to add a style sheet to a very basic module [Partly solved]


Go to End


17 Posts   2423 Views

Avatar
simples

Community Member, 77 Posts

6 August 2012 at 5:39am

Hi jak,

Thank you for your helpful tips and I take your point about observing case.

I have now updated helloworld to show a slideshow.

When I put the following line in module_slideshow/templates/Slideshow.ss

<% require css(module_slideshow/css/slideshow.css) %>

the slideshow becomes styled.

However when I comment out this control structure and instead put the following code in module_slideshow/code/Slideshow.php and refresh both the database and page

<?php

class Slideshow extends Page {
}

class Slideshow_Controller extends Page_Controller {
public function init() {
parent::init();
Requirements::css("module_slideshow/css/slideshow.css");
}
}

the page loses styling.

Unfortunately replacing the Requirements line with

Requirements::themedCSS("slideshow", "module_slideshow");

makes no difference.

Go to Top