![]() |
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! |
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". |
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
|
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. |
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*} 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 ""} 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! |
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 |
Re: Where do I place something in the head tag of the home page?
Thank you! That did the trick!
|
All times are GMT -8. The time now is 02:53 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.