X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Need to add JS to <head> tag (https://forum.x-cart.com/showthread.php?t=60723)

rosenzweig70 08-30-2011 02:38 PM

Need to add JS to <head> tag
I'd like to add this to my <head> tag for all pages...

<script type="text/javascript" src="http://mysite.com/custom.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="http://mysite.com/custom.css" />

I've been searching this forum for well over an hour and I just can't seem to find success. I thought I had it when I found out about common_files/meta.tpl. I've been trying to alter that file, but the changes I'm making don't seem to be showing up.

Anyone lend a hand? Many thanks!

cflsystems 08-30-2011 05:43 PM

Re: Need to add JS to <head> tag
You can add to skin/your_skin/customer/service_head.tpl, if that file doesn't exist in your skin then common_files

rosenzweig70 08-31-2011 09:01 AM

Re: Need to add JS to <head> tag
Thanks! That helped a lot. I've found service_head.tpl file (under skin/common_files/customer/) and I can definitely see that's where this business is done.

My problem now is actually loading the files properly. I don't think I quite understand the syntax of the X-Cart short code language.

In order to pull in this file as I normally would...

<link rel="stylesheet" type="text/css" media="screen" href="http://mysite.com/custom.css" />

... do I need to put brackets around the statement? Or is it necessary to phrase it like this...

{load_defer file="http://mysite.com/custom.css" type="css"}


Actually there's not that much code in my css file -- could I just insert some CSS straight into service_head.tpl? If so how would that be formatted?

Thanks again for sharing your expertise and suffering through my newbness! :-)

cflsystems 08-31-2011 09:31 AM

Re: Need to add JS to <head> tag
You can insert them as you have them in the first post or using the load_defer, either way will work. Use relative paths though

rosenzweig70 08-31-2011 10:08 AM

Re: Need to add JS to <head> tag
Indeed!! All done. Thanks again Steve.

All times are GMT -8. The time now is 10:47 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.