Jump to:

22977 Posts in 11747 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » How does SS use the mysite folder?

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

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

Page: 1
Go to End
Author Topic: 1557 Views
  • jimw
    Avatar
    Community Member
    13 Posts

    How does SS use the mysite folder? Link to this post

    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

  • banal
    Avatar
    Community Member
    901 Posts

    Re: How does SS use the mysite folder? Link to this post

    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.

  • jimw
    Avatar
    Community Member
    13 Posts

    Re: How does SS use the mysite folder? Link to this post

    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?

    1557 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.