Jump to:

1347 Posts in 439 Topics by 514 members

Themes

SilverStripe Forums » Themes » Sub Themes and Modules

Discuss SilverStripe Themes.

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

Page: 1
Go to End
Author Topic: 550 Views
  • Futureweb
    Avatar
    Community Member
    232 Posts

    Sub Themes and Modules Link to this post

    According to http://doc.silverstripe.org/sapphire/en/topics/theme-development I can create sub theme, like "myTheme_forum", copy forum CSS, customize, and it should work....

    However, it doesn't work on a few modules

    It works on the for the Blog module, and eCommerce, but doesn't work on the FORUM module.

    I know one way of fixing it (in forumholder.php parent::init(); needs to be above the list of required files), but this required changing code in the module - which I shouldn't need to do.

    Seeing as the forum module is used by SS in their own example, I would expect it to work. So - am I missing something?

  • Futureweb
    Avatar
    Community Member
    232 Posts

    Re: Sub Themes and Modules Link to this post

    In fact, in the eCommerce, subthemes work with the product page, but not the checkout page. Again, the code is

    public function init() {
          if(!class_exists('Payment')) {
             trigger_error('The payment module must be installed for the ecommerce module to function.', E_USER_WARNING);
          }

          Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
          Requirements::javascript('ecommerce/javascript/CheckoutPage.js');
          Requirements::javascript('ecommerce/javascript/ecommerce.js');
          Requirements::themedCSS('CheckoutPage');

          $this->initVirtualMethods();

          parent::init();
       }

    where i think it should be (note the position of parent::init();)

    public function init() {

          parent::init();
          
          if(!class_exists('Payment')) {
             trigger_error('The payment module must be installed for the ecommerce module to function.', E_USER_WARNING);
          }

          Requirements::javascript(THIRDPARTY_DIR . '/jquery/jquery.js');
          Requirements::javascript('ecommerce/javascript/CheckoutPage.js');
          Requirements::javascript('ecommerce/javascript/ecommerce.js');
          Requirements::themedCSS('CheckoutPage');

          $this->initVirtualMethods();

       }

    I'm trying to build some new all purpose themes, so I'd like to get this working by only using the templates... either that or the owners of the modules could update the code!

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