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

Adding tabs to welcome page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-07-2011, 04:12 PM
 
ScrapbookSupplies ScrapbookSupplies is offline
 

eXpert
  
Join Date: Oct 2009
Location: Texas
Posts: 325
 

Default Adding tabs to welcome page

I am using Smart Template, it comes with a lot of js files.

On the main part of my website (the HTML side outside of xCart) I have an option for adding tabbed boxes (see pic), so I have the necessary js files and scripts to do this. I'm wanting to add these tabs to my xCart home page, but to do this as it is on the HTML part of the site I have to post the "link href" to the js file in the head of the document (welcome.tpl doesn't have a <head></head>). I added <head> tags along with the code when I attempted to put these tabs in; it seemed okay. But then I have to add this script to the page, and this is where I had a problem, it produces a smarty error.

PICTURE OF WHAT I AM TRYING TO ADD:

Click image for larger version

Name:	tabbed-menu-sample.jpg
Views:	138
Size:	52.1 KB
ID:	2427

CODE CAUSING PROBLEM:

HTML Code:
<script type="text/javascript"> // This script is for the accordion $(function() { $("#accordion").accordion({ autoHeight: false, collapsible: true, icons: {'header': 'ui-icon-plus', 'headerSelected': 'ui-icon-minus' } }); }); </script>

So, here's my problem. I really want to add these little tabs but am not sure how it can be done.

Anyone have any ideas? Anyone know of a mod that will let me do this? Anyone up for hire?

I'm stuck!!
Thanks,
__________________
(1) xCart
(1) xPayments

2-12-14 FOR SALE
Reply With Quote
  #2  
Old 02-15-2011, 11:40 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Adding tabs to welcome page

You should not add additional <head></head> tags to the page. You can use webmaster mode to see the template which is creating the code for the <head> section of you page. It could be customer/service_js.tpl

When you add javascript to a smarty template, you should surround it with {literal} {/literal}. This is because javascript and smarty share common syntax, so you need to tell smarty not to interpret your javascript. (Otherwise - it sees you javascript code as smarty code.)

If you only want a block of code to show up on your home page, you can put it inside an if/than statement. Take a look at/customer/home_main.tpl file for some examples of conditions that will display only on certain pages. You probably want the same condition that includes welcome.tpl:
{if $main eq "catalog" and $current_category.category eq ""}

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
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 03:39 AM.

   

 
X-Cart forums © 2001-2020