Jump to:

11002 Posts in 2734 Topics by 1823 members

All other Modules

SilverStripe Forums » All other Modules » Proper way to customize module templates and css?

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1406 Views
  • theoldlr
    Avatar
    Community Member
    103 Posts

    Proper way to customize module templates and css? Link to this post

    Hi,

    I once customized the PageComments template by copying the .ss file to the themes/mysite/templates folder and made my changes there--Worked great, and upgrading should be no problem now. However, the next time I tried to do this was with a template from a module (the blog module if I remember right). This did not work. What is the proper way to do this so upgrading a module is less painful? What about for custom .css files?

    Thanks!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Proper way to customize module templates and css? Link to this post

    Any template that is in your theme dir will override one in a module directory, so in your theme dir, just create BlogHolder.ss, for instance.

    Same with CSS.. provided the module loads the CSS with themedCSS(), you can just put your own stylesheet in your theme dir..

    Requirements::themedCSS('Blog'); will look for Blog.css first in your theme dir, then fall back on the module.

  • kidcardboard
    Avatar
    Community Member
    5 Posts

    Re: Proper way to customize module templates and css? Link to this post

    Maybe it's just me but I'm having issues getting this to work with the TagCloud widget... I've tried putting my own tagcloud stylesheet in my theme directory as well as my theme_blog directory aswell as in a css directory in the both of those, and everytime it would always include the default one from the module. What am I missing. Does it maybe have something to do with the widget adding the stylesheet via

    Requirements::css("blog/css/tagcloud.css");

    instead of

    Requirements:: themedCSS("blog/css/tagcloud.css");

    ??

    1406 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.