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 does SS use the mysite folder?


Go to End


3 Posts   2542 Views

Avatar
jimw

Community Member, 13 Posts

7 July 2009 at 1:38am

I've updated some pages that I have in the mysite folder and they are found and used by SS. However, I can't seem to get css files that I've modified in the mysite folder to be used. I have a css folder in the mysite folder. Where should the css be located so that I can see the changes on my web site?

What should the directory structure look like in the mysite folder? Is there some documentation that could help me understand this?

What I am really trying to do is to change the css to display the event_calendar better with the pixelgreen theme I am using.

Any help would be appreciated.

Thank you, jim

Avatar
bummzack

Community Member, 904 Posts

7 July 2009 at 9:39am

Edited: 07/07/2009 9:41am

Hi Jim

You can place your CSS files wherever you want. The mysite/css folder is actually a good place for them.
Of course you still need to load the required CSS files in your site. You can do that by linking to them in your template code using:

<link rel="stylesheet" type="text/css" href="mysite/css/yourfile.css" />

or simply:
<% require css(mysite/css/yourfile.css) %>

Another method would be to use the Requirements class. Using this approach, you would add a line like the following in the init method of your controller class:

Requirements::css('mysite/css/yourfile.css');

Please note, that all these proposed methods do basically the same. You can pick one that suits you best.

Avatar
jimw

Community Member, 13 Posts

7 July 2009 at 11:10pm

Edited: 07/07/2009 11:12pm

Thanks for the information. However, I am still a little confused on the priority that SS uses in using core code, module code, theme code, and your specific mysite code. I tried your suggestion to add the "require" statement for the css, giving it the location of the css file. It did work partially, but something is still over-riding that css so that it doesn't display as I thought. Maybe it's my css and my still being a newbie and learning SS. Or maybe it's the theme (pixelgreen) that I am using.

I followed the tutorial on making a SiteMap. If you look at my site, you'll see that the bulleted list still has bullets even though the css has list-style-display:none.

Would putting this specific css in the theme css help?