0

I am having trouble getting a css style to unset. Here is what I have tried:

$BaseURL = $this->baseurl;
unset($this->_styleSheets[$BaseURL.'/media/com_namewithheld/css/style.css']);
unset($this->_styleSheets[JURI::root(true).'/media/com_namewithheld/css/style.css']);

neither works, I even tried using the entire sites url? What could be going wrong? All may other unsets are working fine.

Chad J Treadway
  • 422
  • 7
  • 20

1 Answers1

0

If its the Joomla media folder you probably don't need the template part "com_namewithheld/"

$BaseURL = $this->baseurl;
unset($this->_styleSheets[$BaseURL.'/media/css/style.css']);
unset($this->_styleSheets[JURI::root(true).'/media/css/style.css']);

Some components force stylesheets and javascripts to be added, and the unset fails to work through the template.

The best ways I know are:

a) comment out the code: a discussion i had on it

b) use a plugin: JS CSS Control is my recommended usage

Plus if you decide to cache your site - the cached version will ignore your template overrides and add your files - so I recommend plugin method.

Community
  • 1
  • 1
iamrobert
  • 422
  • 5
  • 15