sc456a
asked on
Need to dynamically insert unique code into <head>
I have some Google Publisher ads that I need to setup on a site which require specific code to be inserted into the <head> area of each page, but they need to be unique. In other words, the home page will have certain code in the <head> to correspond with the ads on that page, and the Contact Us page will have different ads and different code in <head>.
I can't seem to find any way to do this dynamically in Joomla 2.5.7. I'm currently using Flexi Custom Code modules for the ad code and that works fine but there is no way to dynamically insert the correct code into the <head> based on the page the visitor is on. I've searched the forums and for extensions - no dice. AdSense extensions won't work because they only inject the ad code - not the <head> code.
I can't seem to find any way to do this dynamically in Joomla 2.5.7. I'm currently using Flexi Custom Code modules for the ad code and that works fine but there is no way to dynamically insert the correct code into the <head> based on the page the visitor is on. I've searched the forums and for extensions - no dice. AdSense extensions won't work because they only inject the ad code - not the <head> code.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I'm not a Joomla man but it seems that the direction to accomplish this should be the template page:
In other words, a script that rebuilds the head section according to the current page id/title, prior to the actual page rendering.
In other words, a script that rebuilds the head section according to the current page id/title, prior to the actual page rendering.
ASKER
I had to try a bunch to find one that would do it: Robert Went's Mod Custom Plus will do the trick. Here is the link:
http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-modules/17842
http://extensions.joomla.org/extensions/core-enhancements/coding-a-scripts-integration/custom-code-in-modules/17842
ASKER