Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Removing requirements from Basic-Galleries without editing modules directly

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 290 Views
  • Avalon
    Avatar
    Community Member
    6 Posts

    Removing requirements from Basic-Galleries without editing modules directly Link to this post

    Running SilverStripe 3.1.1.

    I am trying to remove the CSS requirement for PhotoGalleryHolder pages so then I don't have extra CSS files downloading that I don't even use in my overridden templates.

    This is what I am currently using, but doesn't seem to work:

    mysite/code/PhotoGalleryHolder.php:

    class PhotoGalleryHolderController_Extension extends Extension {
       public function init() {
          Requirements::block("basic-galleries/css/gallery.css");
       }
    }

    mysite/_config.php:

    PhotoGalleryHolder_Controller::add_extension('PhotoGalleryHolderController_Extension');

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: Removing requirements from Basic-Galleries without editing modules directly Link to this post

    you have to use onAfterInit function

    class PhotoGalleryHolderController_Extension extends Extension {

    public function onAfterInit () {
    Requirements::clear("basic-galleries/css/gallery.css");
    }
    }

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