Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Adding HTML code to template

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-04-2003, 09:06 PM
 
wconcepts wconcepts is offline
 

Newbie
  
Join Date: Aug 2003
Posts: 2
 

Default Adding HTML code to template

Newbie here! I am having trouble adding HTML code to the product thumbnail & detail view. I have a current website using another shopping cart program and I am migrating to x-cart. The code works fine on my home page and other shopping cart.

I don't know if I am using the correct syntax since I am unfamiliar to the smarty templates. I'm not sure if I need to include the <html> beggining and ending tags </html>. I'm not sure if I should paste this code prior to the smarty code or at the end.

Basically, I can't find a topic in the forum (Unless I'm not looking in the right area) regarding where and how to place HTML in templates?

I have attached the code below which I am trying to add. The code basically disables the right click option to save to disk if the user is over an image on the page. It also eliminates the auto save option when the mouse hovers over a image.

Any help would be greatly appreciated.

HTML Code:

<html>
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<script language="JavaScript1.2">

/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

var clickmessage="Copyright б╘ 2003 Wireless Concepts"

function disableclick(e)
if (document.all)
if (event.button==2||event.button==3)
if (event.srcElement.tagName=="IMG")
alert(clickmessage);
return false;
}
}
}
else if (document.layers)
if (e.which == 3)
alert(clickmessage);
return false;
}
}
else if (document.getElementById)
if (e.which==3&&e.target.tagName=="IMG")
alert(clickmessage)
return false
}
}
}

function associateimages()
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown=disableclick;
}

if (document.all)
document.onmousedown=disableclick
else if (document.getElementById)
document.onmouseup=disableclick
else if (document.layers)
associateimages()
</script>
</html>
Reply With Quote
  #2  
Old 09-04-2003, 09:35 PM
 
Anti Anti is offline
 

Member
  
Join Date: Jul 2003
Posts: 10
 

Default

Well because it is a script you would want to put it in the head tags.
The head tags are found in xcart/skin1/customer/home.tpl.

Any page that the customer will load will include the home.tpl (i think anyway, maybe not all pages) so just insert the script in the head tags on home.tpl and you should be right.

Also, if your having trouble figuring out what parts of the page are stored in what templates, go into your administration and on the side there is "webmaster mode" or something similar. Start that and it will show you what templates contain what on the given page.

A page can be made of up to 20 templates. All the same page.
Reply With Quote
  #3  
Old 09-05-2003, 12:36 PM
 
wconcepts wconcepts is offline
 

Newbie
  
Join Date: Aug 2003
Posts: 2
 

Default

Thanks for the info regarding the head.tpl, however, I still have questions regarding the following:


If I put in the Head.tpl. What is the correct syntax? Is the begining <html> and ending </html> needed? Does it go before or after the current code in the template?

Thanks
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:23 AM.

   

 
X-Cart forums © 2001-2020