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

How to add CSS to <Head></Head>

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 04-23-2016, 12:27 AM
 
cocopops cocopops is offline
 

Newbie
  
Join Date: Oct 2014
Posts: 7
 

Default How to add CSS to <Head></Head>

Hi,

A lot of 3rd party jQuery/Javascript plug-ins require you to put a line of code in between the <head> </head> tags.

For example, I have a 3rd party Google Maps Plugin that I want to use in a Static Page. It requires me to put the line:
<link rel="stylesheet" type="text/css" href="revolution/css/layers.css">

in between the <head> </head> tags.

My question: Where is the <head> </head> tag located?
Is there a specific template file for static pages where I can find the <head></head> tags?

I am using X-Cart Classic 4.7.5
__________________
X-Cart v4.4.3 Gold
X-Cart Mobile
Reply With Quote
  #2  
Old 04-23-2016, 04:34 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: How to add CSS to <Head></Head>

skin/YOUR_SKIN/customer/home.tpl
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
cocopops (04-24-2016)
  #3  
Old 04-24-2016, 08:49 PM
 
cocopops cocopops is offline
 

Newbie
  
Join Date: Oct 2014
Posts: 7
 

Default Re: How to add CSS to <Head></Head>

Quote:
Originally Posted by cflsystems
skin/YOUR_SKIN/customer/home.tpl
Thanks.

If I need to add javascript, or a link to a .js file between the <body> </body> tags, do I also add it in home.tpl?

For example, if I need to add:
<script src="example.js"></script>

do I add it in home.tpl as well?
__________________
X-Cart v4.4.3 Gold
X-Cart Mobile
Reply With Quote
  #4  
Old 04-25-2016, 05:35 AM
  seyfin's Avatar 
seyfin seyfin is offline
 

X-Cart team
  
Join Date: May 2004
Posts: 1,223
 

Default Re: How to add CSS to <Head></Head>

Yes, you should add it to home.tpl as well.

See also:
* CSS and JavaScript optimization
__________________
Sincerely yours,
Sergey Fomin
X-Cart team
Chief support group engineer

===

Check this out. Totally revamped X-Cart hosting
http://www.x-cart.com/hosting.html

Follow us:
https://twitter.com/x_cart / https://www.facebook.com/xcart / https://www.instagram.com/xcart
Reply With Quote
  #5  
Old 04-26-2016, 05:56 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,052
 

Default Re: How to add CSS to <Head></Head>

If the css and/or js isn't needed on every page, and is only required on one page/place, you might want to add an if statement so it isn't called on every page.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #6  
Old 04-26-2016, 06:24 AM
 
cocopops cocopops is offline
 

Newbie
  
Join Date: Oct 2014
Posts: 7
 

Default Re: How to add CSS to <Head></Head>

Quote:
Originally Posted by pauldodman
If the css and/or js isn't needed on every page, and is only required on one page/place, you might want to add an if statement so it isn't called on every page.

Hmm, that sounds like a good idea.

So for example, if I needed to call the css (sample.css) and js (sample.js) on only 1 of my static pages, say an FAQ page(www.domain.com/faq.html), how would the if statement look?
__________________
X-Cart v4.4.3 Gold
X-Cart Mobile
Reply With Quote
  #7  
Old 04-26-2016, 07:40 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: How to add CSS to <Head></Head>

{if $page_data.pageid eq XX} load {/if}

Where XX is the static page id
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
qualiteam (04-26-2016)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


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 06:47 AM.

   

 
X-Cart forums © 2001-2020