Search
Other Sourcerer questions
Forum

Sourcerer not working to load CSS link in haed section

colin mercer's Avatar colin mercer
Hi
I am trying to add the appropriate css link in the head section of cassiopeia with the free version of Sourcerer - I do have other Regular Labs items as PRO versions. For reference I do the documentation for the jDownloads component
Using your example the code entered is as below:
{source}<?php
   $doc->addStyleSheet( JURI::root((true ).'/media/templates/site/cassiopeia/css/jDdocumentation.css' );
?>{/source}
Presently I have the code at the start of an article that is automatically invoked. Also running as a test site on XAMPP.

So how do I get Sourcerer to run?
ColinM
PS all at latest versions
Peter van Westen's Avatar Peter van Westen ADMIN
Most probably the content you are placing the {source} tags in, is not being passed through the prepare content event.
This means that the time Sourcerer gets to see and handle the {source} tags, the head of the html document is already rendered and fixed.

If you want to do this in a component, you could for instance place this code in a module (type: Custom) and switch on the Prepare Content option in that module.
Please post a rating at the Joomla! Extensions Directory
colin mercer's Avatar colin mercer
Thanks. Having a Prepare Content was what I was missing in my thinking!!!
I will use a custom module as suggested with prepare content active
Colin
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription