<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Local header code</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Wed, 15 Apr 2026 04:13:23 -0000</pubDate>

		<item>
			<title>foxhound</title>
			<description><![CDATA[<span style="text-decoration:line-through">Well, that means you just have to look into the php files to find a variable, right?<br />
You could even use variables which are introduced with plugins.<br />
So, if you need something open the php files and have a look at it. I guess even a noob like me can do that ;-)</span><br />
<br />
<br />
Argh, it redirected me to the wrong topic after login. Sorry.]]></description>
			<pubDate>Mon, 06 Dec 2010 20:54:43 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27374]]></link>
		</item>
		<item>
			<title>Kingsley</title>
			<description><![CDATA[thx for the explanation hodges]]></description>
			<pubDate>Sat, 04 Dec 2010 00:24:26 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27339]]></link>
		</item>
		<item>
			<title>Hodges</title>
			<description><![CDATA[Look here for a good answer: <a href="http://stackoverflow.com/questions/196702/where-to-place-javascript-in-a-html-file" rel="nofollow">http://stackoverflow.com/questions/196702/where-to-place-javascript-in-a-html-file</a><br />
<br />
Specifically:<br />
<blockquote><div style="text-align:justify">Also, the reason why Yahoo EPT recommends placing JS at the bottom is because the browser must go into single-threaded mode while the JS loads and then executes. If the script is in the head or in the midst of the content, the browser will &quot;pause&quot; while it deals with the JS. By placing the JS at the bottom, the content will be loaded and generally visible so the user can start reading it while the browser is still dealing with the JS.</div></blockquote>]]></description>
			<pubDate>Fri, 03 Dec 2010 22:52:51 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27338]]></link>
		</item>
		<item>
			<title>Kingsley</title>
			<description><![CDATA[<blockquote><a href="https://www.cotonti.com/forums.php?m=posts&amp;p=27326#27326">#</a> <strong>Koradhil :</strong>
Also you normally shouldn't put javascript in the header, but in the footer (just before &lt;/body&gt;). <br />
</blockquote>
<br />
why is that?]]></description>
			<pubDate>Fri, 03 Dec 2010 22:43:23 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27337]]></link>
		</item>
		<item>
			<title>Hodges</title>
			<description><![CDATA[Cheers everyone.<br />
<br />
In the end I went with Koradhil's code in the page body. Works a treat.<br />
<br />
Damn I really should learn how to use jquery now <img class="aux smiley" src="https://www.cotonti.com/./images/smilies/tongue.gif" alt=":P" />]]></description>
			<pubDate>Fri, 03 Dec 2010 22:37:13 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27336]]></link>
		</item>
		<item>
			<title>pieter</title>
			<description><![CDATA[<blockquote><a href="https://www.cotonti.com/forums.php?m=posts&amp;p=27328#27328">#</a> <strong>ez :</strong>
The tags are pretty easy to find in the php files, but you are right a list should be nice..<br />
There are some here: <a href="http://www.cotonti.com/plug.php?e=tpltags">http://www.cotonti.com/plug.php?e=tpltags</a><br />
</blockquote>
<br />
Some explanation next to it, would be nice]]></description>
			<pubDate>Fri, 03 Dec 2010 04:58:32 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27333]]></link>
		</item>
		<item>
			<title>ez</title>
			<description><![CDATA[It is not required to put JS in the header.... It is cleaner, but you can use it anywhere.<br />
<br />
So just put your js in your page !<br />
<br />
<br />
@Pieter:<br />
The tags are pretty easy to find in the php files, but you are right a list should be nice..<br />
There are some here: <a href="http://www.cotonti.com/plug.php?e=tpltags">http://www.cotonti.com/plug.php?e=tpltags</a>]]></description>
			<pubDate>Fri, 03 Dec 2010 03:25:36 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27328]]></link>
		</item>
		<item>
			<title>pieter</title>
			<description><![CDATA[@Koradhil<br />
Suggestion for documentation:<br />
List of most used tags<br />
{PAGE_ID}<br />
{PHP.al}<br />
....<br />
There are so many that nobody knows them all. Execpt programmers.]]></description>
			<pubDate>Fri, 03 Dec 2010 03:08:22 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27327]]></link>
		</item>
		<item>
			<title>GHengeveld</title>
			<description><![CDATA[Don't use body onload, its very dirty. Also you normally shouldn't put javascript in the header, but in the footer (just before &lt;/body&gt;). If you use html parsing in pages you can just as well put it directly in the page body, right where you want the map to be displayed. It's not the best solution, but OK if it's just one page using it. Otherwise put it in page.tpl and try this:<br />
&lt;!-- IF {PAGE_ID} == xx --&gt; JS code &lt;!-- ENDIF --&gt;<br />
Replace xx with the ID of the page you want the map to display on.<br />
You can also try pieters suggestion but that requires the page to have an alias. His code will work in footer.tpl as well (probably an even better solution).<br />
<br />
Try this:<br />
<div class="highlight"><pre class="js">&lt;script type=&quot;text/javascript&quot;&gt; 
  function initialize() {
    var myLatlng = new google.maps.LatLng(53.381883, -1.477755);
    var myOptions = {
      zoom: 15,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById(&quot;map_canvas&quot;), myOptions);
    
    var marker = new google.maps.Marker({
        position: myLatlng, 
        map: map,
        title:&quot;Sir Robert Hadfield Building&quot;
    });   
  }
  jQuery(document).ready(function(){ initialize(); });
&lt;/script&gt;</pre></div>
<br />
Don't forget to remove the onload=&quot;initialize()&quot;]]></description>
			<pubDate>Fri, 03 Dec 2010 02:47:10 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27326]]></link>
		</item>
		<item>
			<title>pieter</title>
			<description><![CDATA[you can give the page:<br />
OR specific header: that page in another category and use header.CAT.tpl<br />
<br />
OR maybe give your page an alias and add following in the standard header:<br />
<br />
&lt;!-- IF {PHP.al} == 'your_pagealias' --&gt;<br />
YOUR_CODE<br />
&lt;!-- ENDIF --&gt;]]></description>
			<pubDate>Fri, 03 Dec 2010 02:04:59 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27325]]></link>
		</item>
		<item>
			<title>Hodges</title>
			<description><![CDATA[Hey,<br />
<br />
I've got a google map on a page set to html mode. To make it work I require this in the header:<br />
<br />
<div class="highlight"><pre class="html">&lt;script type=&quot;text/javascript&quot;&gt; 
  function initialize() {
    var myLatlng = new google.maps.LatLng(53.381883, -1.477755);
    var myOptions = {
      zoom: 15,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById(&quot;map_canvas&quot;), myOptions);
    
    var marker = new google.maps.Marker({
        position: myLatlng, 
        map: map,
        title:&quot;Sir Robert Hadfield Building&quot;
    });   
  }
&lt;/script&gt;</pre></div>
<br />
And this in the body tag:<br />
<br />
<div class="highlight"><pre class="html">&lt;body onLoad=&quot;initialize()&quot;&gt;</pre></div>
<br />
Thing is, I don't won't this code including anywhere else on the site. How would you guys solve this elegantly?<br />
<br />
Cheers.]]></description>
			<pubDate>Fri, 03 Dec 2010 01:24:46 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=6063&d=0#post27323]]></link>
		</item>
	</channel>
</rss>