Page 1 of 1

Creating a new template problems with java script?

Posted: Mon Apr 23, 2007 1:59 am
by TJINAK
Hello,

I'm trying to create my own cmsms template based on a home page for a site I have.

The page that I'm using to make my template is using html tables, images, and java script. 

I started by creating a blank template and pasting my html into the template.  I saved the template as cpo_home.

Then I uploaded all the required images to my cmsms images dir.

Finally I went to create a new page based on my template but ran into problems.  Here you will find the errors i'm getting.

http://pcs-alaska.com/mjustindmd/template_error.htm

Although, I'm not a programmer it looks like the java script is creating the problems.

Can anyone please advise I how I might resolve these issues.

Thank you for your time and consideration,

Tim

Here is the template I've created:

Central Peninsula Orthodontics










mmLoadMenus();

 
   
   
   
   
   
   
   
   
   
   
   
   
 

 
   
   
 
 
   
   



   
   
 
 
   
   
 
 
   
   
   
   
 
 
   
   
 
 
   
   
   
   
 
 
   
   
 
 
   
   
 
 
   
   
   
   
 
 
   
   
 
 
   
   
 
 
   
   
   
 
 
   
   
   
 
 
   
   
 
 
   
   
   
   
 
 
   
   
 
 
   
   
 
 
   
   
 
 
   
   
 
 
   
   
 
 
   
   
 
 
   
   
 
 
    
   
 










Re: Creating a new template problems with java script?

Posted: Mon Apr 23, 2007 2:28 am
by JohnnyB
yep, it looks like a template error.  It is actually smarty (the templating system) telling you that something is wrong in your template.

You need to wrap your javascript in the {literal}{/literal} tags.

Or, create an external javascript file(s) and link to them inside the head.

For example:

{literal}


{/literal]

OR




BTW.  this is depracted (the old and soon to be unsupported method) of writing a javascript tag:
You should be using:
Also, it will help you out if you are using a DOCTYPE above the
see:
http://wiki.cmsmadesimple.org/index.php ... _Templates
and
http://wiki.cmsmadesimple.org/index.php ... /Templates

To get started with your templates.

Re: Creating a new template problems with java script? [RESOLVED]

Posted: Mon Apr 23, 2007 3:08 am
by TJINAK
Thank you very much for your reply!

I've made the changes and they worked perfect!

My first design that I've plugged into cmsms!

A very BIG THANK YOU FROM ALASKA!!

I also appreciate the link you sent I will read them and bring my code up to date.

Tim

Re: Creating a new template problems with java script?

Posted: Mon Apr 23, 2007 4:46 am
by cyberman
For multiple javascript inserts you can use this nice plugin :)

http://forum.cmsmadesimple.org/index.ph ... l#msg51635

Re: Creating a new template problems with java script?

Posted: Tue Apr 24, 2007 12:35 am
by JohnnyB
cyberman wrote: For multiple javascript inserts you can use this nice plugin :)

http://forum.cmsmadesimple.org/index.ph ... l#msg51635
This is very cool!  does this create one file on the fly for all the JS in the directory? Or, does it load each JS file individually.

(I suppose I could test it to answer my question, but I don't have a site that is in development at the moment with JS...)

Re: Creating a new template problems with java script?

Posted: Tue Apr 24, 2007 5:51 am
by cyberman
mww wrote: does it load each JS file individually.
Yep.