Support Forum

Please note that this forum is only available to you in read only mode. In order to contribute to this conversation you will need to renew your subscription.

Code Injection - paths

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Hi

I use the template 'injection' to include scripts into the section Before /head

How can I specify the correct path to the js or css file?
I develop a site in a subdirectory then move it to its own domain
In a subdir I have to include that subdir in the src='/subdir/path-to-js' within the script tag
Then when I move the site I have to remove this 'subdir'
Can I use a PHP variable here ??

Thanks
  • richarddhill's Avatar
  • richarddhill
  • 6 Month Developer
  • 193 posts
  • 3 Thanks
  • Karma: 5
The administrator has disabled public write access.
Hi Richard,

You would have to test but I think php might not get executed.

If it works then you could use a joomla constant docs.joomla.org/Constants

Otherwise, could you not make the path relative to the domain or the template folder?

Regards,
Rob
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.
I just tried locally and php gets outputted without being run so you would be best to use a relative path.
  • Robert Went's Avatar
  • Robert Went
  • Moderator
  • 2210 posts
  • 196 Thanks
  • Karma: 90
The administrator has disabled public write access.

zentoolsIf you use Zentools please post a review at the Joomla! Extensions Directory.

Happy Campers