Placing code just before </body>

Support forum dedicated to GameNews game Joomla template perfect for gamers, game portal news and reviews with dedicated extensions for rating and video support
Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Mon May 27, 2013 6:34 am
Reply with quote
Report this post
Hi Guys

I'm trying to place some third party tracking code so it appears just before the end of the body section </body>.

I've placed the code just before </body> in /templates/gk_gamenews/layouts/default.php but a whole load of JavaScript appears after it, so it's not the last bit of code before </body>.

You can see I've put in a commented line "// AMAA and Nielsen tracking code" on this page: http://118.88.19.171/~coastliv/

Any idea how to make the code appear right before </body>?

Thanks.

Nick
User avatar
Fresh Boarder

GK User
Mon May 27, 2013 7:33 am
Reply with quote
Report this post
It seems that there is a plugin on your site, that moves entire javascript code from header to footer.
You could try to place callout to your js in
/template/gk_gamenews/layouts/blocks/header.php
witho use of:
$this->API->addJS($this->API->URLtemplate() . '/js/FILENAME.js');
to load FILENAME.js from templates/gk_gamenews/js/ folder.
User avatar
Moderator

GK User
Mon May 27, 2013 7:59 am
Reply with quote
Report this post
Thanks for pointing that out, I thought the code looked strange.

I'll find the offending plugin. Are you able to tell what plugin is causing that?
User avatar
Fresh Boarder

GK User
Mon May 27, 2013 8:26 am
Reply with quote
Report this post
I dont know what plugin does it, but if You will put code to head.php, just at its end, I hope it should do the trick.
User avatar
Moderator

GK User
Mon May 27, 2013 8:43 am
Reply with quote
Report this post
I put:

$this->API->addJS($this->API->URLtemplate() . '/js/FILENAME.js');

at the bottom of the head.php file but nothing changed.

If I find the plugin that's moving the js and disable it, will my previous method of putting something at the end of default.php work?

Or can you suggest anything else?

Thanks.
User avatar
Fresh Boarder

GK User
Mon May 27, 2013 9:06 am
Reply with quote
Report this post
Please send me a PM with:
1. URL to your website
2. login and password of user with admin/super-admin privileges (please create one for me)
3. ftp data (host, user, password)
4. link to this thread

Ill try to check what's wrong.
User avatar
Moderator

GK User
Tue May 28, 2013 3:17 am
Reply with quote
Report this post
I've PMed you with the details.

Thanks.
User avatar
Fresh Boarder

GK User
Wed May 29, 2013 9:25 am
Reply with quote
Report this post
Hi

Please disregard this now. I found the offending plugin - JSN Framework. It's disabled and the javascript is back in the header.

Thanks.
User avatar
Fresh Boarder

GK User
Wed May 29, 2013 10:19 am
Reply with quote
Report this post
Thanks for the reply... It might come handy for someone else too.
User avatar
Moderator


cron