Joomla Plugin css override

323 views Asked by At

Is it possible to override a css file inside a joomla plugin?

I want to change some css styles for the plugin Simple Image Gallery. I found the concerning css file in the joomla folder:

plugins/content/jw_sig/jw_sig/tmpl/Classic/css/template.css

Now I made some changes inside of this template.css file and saved it here in the template folder:

templates/my_template/html/content/jw_sig/jw_sig/Classic/css

It does not work. My css changes do not appear in the gallery.

2

There are 2 answers

1
AudioBubble On

I do not think that this is possible without core hacks or extensions (But lets wait for other answers).

But it not seems to be a joomla core plugin so why you just alter the original css file? It should not be overriden via a update (cos its no core plugin)?

Method 2: you can copy (download files and rename the plugin + reinstall) the plugin and disable the original one.

Method 3: try to ovverride the css defenitions in your own css file (with !important) and override them via your file!

2
Alex On

A good way to override css is to add the same selectors (with same attributes) and put these in your template css. If the template css is loaded after the other css, then your definitions have a higher prio. Otherwise you can add the 'body' selector before your selectors or write after each value an '!important', but this method is a little bit messy.

Another method is to unset the css if possible (only works if css is loaded in head), e.g.

unset($doc->_styleSheets[$this->baseurl.'/path/to/some.css']);