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

smarty variable for welcome page?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-08-2010, 02:26 AM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 758
 

Default smarty variable for welcome page?

which smarty template variable differentiates the initial home page (welcome page) from the rest catalog pages? In other words, in all these pages (home welcome page and any category/product viewing pages) the "$main" variable is set to "catalog". Is there any other smarty variable through which the code could differentiate between being in the welcome page and being in another catalog page? (after I did the usual smarty.php modification for outputting smarty variable values in the debug console, I have searched for any related assigned template variable but I couldn't find anything).
Reply With Quote
  #2  
Old 03-08-2010, 02:40 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

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

Default Re: smarty variable for welcome page?

This is for the home page:
$main eq "catalog" && $current_category.category eq ""
__________________
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
  #3  
Old 03-08-2010, 03:10 AM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 758
 

Default Re: smarty variable for welcome page?

thanks pauldodman.
I had realized something about the "$current_category" variable but your response was so fast, I didn't have enough time to discover that myself
Also, I would like to add something for the sake of some more tips from my part....
I have modified the home page so that it doesn't output the root categories initially. These are output when the visitor clicks on a "Our Products" hard-coded link in the navigation menu. For this, I injected a custom variable $display_cats in the template code, with it's value set to "Y" when the visitor clicks on the "Our Products" link and the root categories display. So, since I want to differentiate the home page from this page also (i.e. the root categories display page), I also added the $display_cats variable in the conditional statement of smarty,so the code knows that the home page is displayed, and not the page which displays the root categories, i.e.
Code:
$main eq "catalog" && $current_category.category eq "" && $display_cats ne "Y"

Thanks again...
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 06:16 PM.

   

 
X-Cart forums © 2001-2020