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.

All other Modules /

Discuss all other Modules here.

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

Removing requirements from Basic-Galleries without editing modules directly


Go to End


2 Posts   935 Views

Avatar
Avalon

Community Member, 6 Posts

10 November 2013 at 5:45pm

Edited: 10/11/2013 5:51pm

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');

Avatar
Nivanka

Community Member, 400 Posts

3 December 2013 at 5:32am

Edited: 03/12/2013 5:32am

you have to use onAfterInit function

class PhotoGalleryHolderController_Extension extends Extension { 

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