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

Where do I place something in the head tag of the home page?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-04-2011, 10:58 PM
 
imimin imimin is offline
 

Senior Member
  
Join Date: Mar 2007
Posts: 195
 

Default Where do I place something in the head tag of the home page?

OK, I give up! I am using v4.4.2 and working with the 'fashion_mosaic_grey' template. I need to place some JS in the head of my homepage, but can't figure out which file to place it in! I tried the customer/home.tpl file on both the common files folder and the 'fashion_mosaic_grey' area, but does not show up on final home page output. I figured out where the actual display part goes (welcome.tpl) and it is working fine.

I am sorry if I sound like I am complaining, but I am about ready to pull my hair out trying to figure out all this basic file location stuff! Why does it have to be so complex to do something so simple?

Can someone please help me out!

THANK YOU!
__________________
Demoing v4.4.2 for new site
Licensed v4.0.19
Reply With Quote
  #2  
Old 05-04-2011, 11:13 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: Where do I place something in the head tag of the home page?

Try disabling the "Do not check if templates are changed (Smarty compile_check)." option on the "General settings -> General options" page.

Also, try the "Webmaster mode" and "Firebug".
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote

The following user thanks qualiteam for this useful post:
imimin (05-05-2011)
  #3  
Old 05-05-2011, 02:45 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Where do I place something in the head tag of the home page?

If still in development phase disable that option, you may also need for some template chages to appear to clear the cache - cleanup.php
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
imimin (05-05-2011)
  #4  
Old 05-05-2011, 03:03 AM
  DrQuietus's Avatar 
DrQuietus DrQuietus is offline
 

Advanced Member
  
Join Date: Dec 2005
Posts: 81
 

Default Re: Where do I place something in the head tag of the home page?

Add it to the bottom of /common_files/meta.tpl using an if statement

{if $main eq "catalog" and $current_category.category eq ""}
js
{/if}

This will only load it when on the homepage, I do this all the time for slideshows and such. Depending on the js, you could get conflicts.
__________________
Dave Jones
dave@industrialwebworks.net
Mostly 4.7.2 - 4.7.5
Reply With Quote

The following user thanks DrQuietus for this useful post:
imimin (05-05-2011)
  #5  
Old 05-05-2011, 07:02 AM
 
imimin imimin is offline
 

Senior Member
  
Join Date: Mar 2007
Posts: 195
 

Default Re: Where do I place something in the head tag of the home page?

Thanks guys! I got the JS to print to the head area.

I still have a problem (let me know if I should start another post?) I am in fact working on putting in a slide show on the home page of my site. My slide show is not working (had this code (similar) working in another (non-xcart) php site before). I think I have an issue with syntax in the .tpl file(s).

In the "fashion_mosaic_grey/customer/main/wecome.tpl" file I put the following table:

Code:
{*FOLLOWING IS FOR THE DYNAMIDRIVE FADE SLIDESHOW*} <table align='right' border="0" bordercolor="#fff" style="background-color:#fff" width="600" cellpadding="0" cellspacing="0"> <tr> <td> <div id="fadeshow1"></div> <div id="fadeshow2"></div> {*<div id="fadeshow2toggler" style="width:300px; text-align:center; margin-top:10px"> <a href="#" class="prev"><img src="http://i31.tinypic.com/302rn5v.png" style="border-width:0" /></a> <span class="status" style="margin:0 50px; font-weight:bold"></span> <a href="#" class="next"><img src="http://i30.tinypic.com/lzkux.png" style="border-width:0" /></a> </div>*} </td> </tr> </table> {*ABOVE IS FOR THE DYNAMIDRIVE FADE SLIDESHOW*}

and in the "common_files/customer/meta.tpl" file I put this at the end:

Code:
{if $main eq "catalog" and $current_category.category eq ""} {*BELOW CODE IS FOR THE DYNAMIC DRIVE SLIDE SHOW*} <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="fadeslideshow.js"> /*********************************************** * Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more ***********************************************/ </script> <script type="text/javascript"> var mygallery=new fadeSlideShow(( wrapperid: "fadeshow1", //ID of blank DIV on page to house Slideshow dimensions: [300, 300], //width/height of gallery in pixels. Should reflect dimensions of largest image imagearray: [ ["../../../images/Ztest/110115.jpg, "", "", ""], ["../../../images/Ztest/110825.jpg", "", "", ""], ["../../../images/Ztest/111225.jpg", "", "", ""] //<--no trailing comma after very last image element! ], displaymode: (type:'auto', pause:2500, cycles:0, wraparound:false), persist: false, //remember last viewed slide and recall within same session? fadeduration: 500, //transition duration (milliseconds) descreveal: "none" )) var mygallery2=new fadeSlideShow(( wrapperid: "fadeshow2", //ID of blank DIV on page to house Slideshow dimensions: [300, 300], //width/height of gallery in pixels. Should reflect dimensions of largest image imagearray: [ ["../../../images/Ztest/111476.jpg", "", "", ""], ["../../../images/Ztest/111512.jpg", "", "", ""], ["../../../images/Ztest/111848.jpg", "", "", ""] //<--no trailing comma after very last image element! ], displaymode: (type:'auto', pause:2500, cycles:0, wraparound:false), persist: false, //remember last viewed slide and recall within same session? fadeduration: 500, //transition duration (milliseconds) descreveal: "none" )) </script> {*ABOVE CODE IS FOR THE DYNAMIC DRIVE SLIDE SHOW*} {/if}

In the original code I found on DynamicDrive, there were brackets in place of the red and blue parenthesis in the second set of code above, but it didn't work (it didn't print the info between the brackets)(?maybe improper syntax for TPLs?) so I replaced with parenthesis which printed fine though I am not sure if the parenthesis work in the fadeshow code?

Any ideas on this on this? Maybe what I need to do is get the brackets to print in the head? If so, how?

Thank you!
__________________
Demoing v4.4.2 for new site
Licensed v4.0.19
Reply With Quote
  #6  
Old 05-05-2011, 08:32 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Where do I place something in the head tag of the home page?

surround the scripts with {literal} {/literal}

http://www.smarty.net/docs/en/language.function.literal.tpl
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
imimin (05-05-2011)
  #7  
Old 05-05-2011, 09:02 AM
 
imimin imimin is offline
 

Senior Member
  
Join Date: Mar 2007
Posts: 195
 

Default Re: Where do I place something in the head tag of the home page?

Thank you! That did the trick!
__________________
Demoing v4.4.2 for new site
Licensed v4.0.19
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 05:22 AM.

   

 
X-Cart forums © 2001-2020