Getting JS Into <head>

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
dealfiles
New Member
New Member
Posts: 3
Joined: Thu Mar 31, 2011 2:02 pm

Getting JS Into <head>

Post by dealfiles »

Hi all,

I am having a heck of a time getting a javascript call into the <head> section of my template. I have tried using a user created tag, and I have tried a {literal}{/literal} tag, all to no avail.

Here is what I have now:

Code: Select all

{literal}
<__script__ type="text/javascript" src="http://tacomaautorepairshop.com/js_vid/mootools.js"></__script>
<__script__ type="text/javascript" src="http://tacomaautorepairshop.com/js_vid/swfobject.js"></__script>
<__script__ type="text/javascript" src="http://tacomaautorepairshop.com/js_vid/videobox.js"></__script>
<link rel="stylesheet" href="http://tacomaautorepairshop.com/css/videobox.css" type="text/css" media="screen" />
{/literal}
But when I view the page in my browser and view the source code, this is all that's showing up:

Code: Select all

<style type="text/css" media="screen">
    object { outline:none; }
</style>
Hopefully someone can tell me EXACTLY what I'm doing wrong, and PRECISELY how to implement this, because I am not a neophyte when it comes to html and js, but CMS Made Simple really has me stumped.

Thanks in advance for any and all help provided.

Tom
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Getting JS Into <head>

Post by Dr.CSS »

When I put the link to those JS files in my browser I get a file not found error, check and make sure all paths are correct...

The only time you need {literal} tags is when you are using something with { } in it...
dealfiles
New Member
New Member
Posts: 3
Joined: Thu Mar 31, 2011 2:02 pm

Re: Getting JS Into <head>

Post by dealfiles »

OK, thanks for the reply... I have fixed the paths so that all the files are accessible, and I have removed the {literal}{/literal} tags, but the code still isn't showing up in "View Source" in my browser.

I am certain I'm still missing something.
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Getting JS Into <head>

Post by Wishbone »

Dr.CSS wrote:When I put the link to those JS files in my browser I get a file not found error, check and make sure all paths are correct...
It doesn't make sense to me that the fact that the files are missing would cause it to be removed from the source.
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: Getting JS Into <head>

Post by M@rtijn »

Could it be that you've put those JS calls in different template than the one you are using right now?
Make your community a better place!
dealfiles
New Member
New Member
Posts: 3
Joined: Thu Mar 31, 2011 2:02 pm

Re: Getting JS Into <head>

Post by dealfiles »

Color me VERY red... That's exactly the problem. I was putting it into the DEFAULT template, never realizing it wasn't the template for the page I was working on.

Much appreciation for helping me. Many blessings!

Tom
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm

Re: Getting JS Into <head>

Post by M@rtijn »

It happens to the best ;D
Make your community a better place!
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: Getting JS Into <head>

Post by Wishbone »

I tend to put all common template snippets into non-WYSIWYG GCBs.. so that similar templates have NOTHING in common, except for the GCB calls. Edit the GCB and you have updated all templates that use it. Good catch M@rtijn!
Post Reply

Return to “CMSMS Core”