Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14361 reviews 1715 hosting providers

Questions & Answers

Joomla 3 add additional CSS for signed in users

Jun 3, 2013 by jomnew

I have Joomla 3 website and I want to be able to add and load an additional specific CSS stylesheet when users log in to my website,  and edit a specific article in the frontend. How can I do this? Any advice will be highly appreciated.
Thank you

1 Answer

0 votes
Jun 3, 2013 by FixHost
Try using  Sourcerer plugin to inject your custom code to the page.

Then try creating a Custom HTML module, that is visible only for registered users
Try this code to inject the stylesheet inside <head> tag

      defined("_JEXEC") || die();
      $doc =& JFactory::getDocument();
      /* Injects <link rel="yourstylesheet" href="yourstylesheet.css" type="text/css" /> inside <head></head> tags */
      $doc->addCSS ( 'yourstylesheet.css' );