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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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   715 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"); 
   } 
}