Question : How do I get the <head> section in a Joomla site to include different java script  links depending on what page is accessed?

I need to include different script types on different pages according to which page is accessed.

Example 1
if the following page is accessed
http://www.adelaidehillstoyota.com.au/new2/showroom/hybrid/hybrid-camry

I need that page to have the code below within the <head></head>

<script type="text/javascript" src="http://www.toyota.com.au/toyota/main/js/webtrends.js"></script>
<script type="text/javascript" src="http://www.toyota.com.au/toyota/main/js/tracking.js"></script>
<script type="text/javascript">
        webtrendsTag('Dealer', 'Hybrid-Camry-eBrochure');
</script>

Example 2
if the following page is accessed
http://www.adelaidehillstoyota.com.au/new2/showroom/passenger/aurion

I need that page to have the code below within the <head></head>

<script type="text/javascript" src="http://www.toyota.com.au/toyota/main/js/webtrends.js"></script>
<script type="text/javascript" src="http://www.toyota.com.au/toyota/main/js/tracking.js"></script>
<script type="text/javascript">
        webtrendsTag('Dealer', 'Aurion-eBrochure');
</script>

I think it needs to be done somehow using the <jdoc:include type="head" />

Hope someone can help

Kind Regards
Robin Custance

Answer : How do I get the <head> section in a Joomla site to include different java script  links depending on what page is accessed?

HI Robin,

This handy little Joomla utility should do what you want:  JosTag

http://extensions.joomla.org/extensions/site-management/seo-a-metadata/5139

Check out the reviews including my review.

Then if you have questions post them here.  I think it will do what you want.

Random Solutions  
 
programming4us programming4us