Joomla 3 add additional CSS for signed in users

asked Jun 3, 2013 in Website Builder by jomnew (2,180 points)

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 like 0 dislike
answered Jun 3, 2013 by FixHost (12,380 points)
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' );