cksrc
cksrc

Reputation: 2347

Overwrite template's stylesheet with the one from custom component in Joomla

In my custom Joomla 3 extension I am using Bootstrap 2.3.2 for the front-end. I noticed that the default Joomla template protostar overwrites default Bootstrap classes which is not what I would like. Is there a way to load my stylesheet after the template's stylesheets so they overwrite any common rules may exist?

Upvotes: 0

Views: 66

Answers (1)

Jobin
Jobin

Reputation: 8272

Try something like this,

This will add the css at your component calling time inside the component HTML section . Keep in mind it will not add the css at head section but for sure it will appear after the template css

    $stylelink = '<link rel="stylesheet" href="../css/css.css" />';
    $document = JFactory::getDocument();
    $document->addCustomTag($stylelink);

Hope it works..

Upvotes: 1

Related Questions