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.
tpelek
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Apr 08, 2010 8:29 am

Load module CSS after template CSS using addStyleShees

Postby 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

Postby 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: 10
Joined: Thu Apr 08, 2010 8:29 am

Re: Load module CSS after template CSS using addStyleShees

Postby 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: 33408
Joined: Sat Apr 05, 2008 9:58 pm

Re: Load module CSS after template CSS using addStyleShees

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


Return to “Joomla! 2.5 Coding”

Who is online

Users browsing this forum: No registered users and 3 guests