Load module CSS after template CSS using addStyleShees

For Joomla! 2.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Note: All 1.6, 1.7 and 3.5 releases have reached end of life and should be updated to 3.x.

Moderator: ooffick

Forum rules
Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.
Locked
tpelek
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Apr 08, 2010 8:29 am

Load module CSS after template CSS using addStyleShees

Post by tpelek » Mon Feb 04, 2013 8:53 pm

Hello,
I use the following code in custom module

Code: Select all

$document =& JFactory::getDocument();
$document->addStyleShees
to load CSS in head.

The problem is that the CSS goes first in head and before template CSS,
so became override by template CSS.

There is any way to add this CSS at the end of head or after templates CSS ?

Thanks in advance

oleolson
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Feb 02, 2013 8:18 pm

Re: Load module CSS after template CSS using addStyleShees

Post by oleolson » Wed Feb 06, 2013 10:29 am

Haven't a solution directly but you can try to add

!important

to your styles you want to override with your module css. Example:

Code: Select all

.theOverrideClass {
color: #FFF !important;
}

tpelek
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Thu Apr 08, 2010 8:29 am

Re: Load module CSS after template CSS using addStyleShees

Post by tpelek » Thu Feb 07, 2013 8:59 am

I was wondering if there is any solution to add the css to the end of the head.

thanks anyway.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 36119
Joined: Sat Apr 05, 2008 9:58 pm

Re: Load module CSS after template CSS using addStyleShees

Post by Webdongle » Mon Nov 13, 2017 1:46 pm

Are you adding the template.css like

Code: Select all

// Add Stylesheets
JHtml::_('stylesheet', 'template.css', array('version' => 'auto', 'relative' => true));
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"The definition of insanity is doing the same thing over and over again, but expecting different results": Albert Einstein


Locked

Return to “Joomla! 2.5 Coding”