Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

help in xt:commerce

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
smsm2000
Smarty Rookie


Joined: 15 May 2012
Posts: 6

PostPosted: Tue May 15, 2012 11:42 pm    Post subject: help in xt:commerce Reply with quote

hello every body i use xt:commerce to build website for one client and this commerce use smarty its first time for me to use smarty and this xtcommerce so i need one small help i want to hide one box for example the tabs to be only in the front page not all pages here is code in html using smarty to display the box

Code:
<div id="tabs-data">
{if $show_index_boxes == 'true'}
{box name=tabs}
{/if}
</div>


and if i change true to be false will hide the box but from all pages so any one can give me solution and help for this please thanks for all and hope to get help
Back to top
View user's profile Send private message
adn
Smarty Regular


Joined: 31 May 2011
Posts: 91

PostPosted: Wed May 16, 2012 8:31 am    Post subject: Reply with quote

I don't really understand what is your problem

If $show_index_boxes is a boolean, you should use

Code:
{if $show_index_boxes == 'true'}
Back to top
View user's profile Send private message Visit poster's website
ChrisFah
Smarty Pro


Joined: 02 Nov 2009
Posts: 159
Location: Traun, Austria

PostPosted: Wed May 16, 2012 8:10 pm    Post subject: Reply with quote

Hi,
just try this:
Code:

{if $smarty.server.REQUEST_URI == '/'}
<div id="tabs-data">
{if $show_index_boxes == 'true'}
{box name=tabs}
{/if}
</div>
{/if}


The "{if $smarty.server.REQUEST_URI == '/'}" only shows the following lines, if the requested uri is the root (if you use domain.com/index.html you have to change the '/ ' into 'index.html'.

Regards, Chris
Back to top
View user's profile Send private message
smsm2000
Smarty Rookie


Joined: 15 May 2012
Posts: 6

PostPosted: Sat May 19, 2012 12:16 am    Post subject: Reply with quote

hello chris thanks and sorry for late answer i have try the code and i have replace / ' into 'index.html'.

but is not working i submit the page here that you can check the problem
here is the link http://www.supermarchebeka.com/site/

and here for example product page you will see the tabs still you can see it
http://www.supermarchebeka.com/site/index.php?page=product&info=7

and here another page
http://www.supermarchebeka.com/site/index.php?page=cart

i try your code but not working waiting for your replay and thanks allot
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat May 19, 2012 9:52 am    Post subject: Reply with quote

If $show_index_boxes is a boolean it must be

Code:
<div id="tabs-data">
{if $show_index_boxes == true}
{box name=tabs}
{/if}
</div>


true without quotes
Back to top
View user's profile Send private message
smsm2000
Smarty Rookie


Joined: 15 May 2012
Posts: 6

PostPosted: Sat May 19, 2012 1:29 pm    Post subject: Reply with quote

hello U.Tews thanks for your answer but i try as you say but its not working also i just want to keep the tabs in the home page and hide it from other page i use as you tell true without quotes but all what i get is margin space in the bottom between content and tabs you can check it here

http://www.supermarchebeka.com/site/

do you any solution please thanks allot Grateful what you did to help me
all my kind regards
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat May 19, 2012 1:40 pm    Post subject: Reply with quote

insert a {debug} tag in your template and check the value of $show_index_boxes
Back to top
View user's profile Send private message
smsm2000
Smarty Rookie


Joined: 15 May 2012
Posts: 6

PostPosted: Sat May 19, 2012 2:07 pm    Post subject: Reply with quote

sorry i don't understand so much i am newbie in smarty and in templates so so can you can explain for me little its in the HTML or in the smarty files
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun May 20, 2012 9:22 am    Post subject: Reply with quote

Insert {debug} on top of the template file(s) where you test $show_index_boxes
Back to top
View user's profile Send private message
smsm2000
Smarty Rookie


Joined: 15 May 2012
Posts: 6

PostPosted: Sun May 20, 2012 2:42 pm    Post subject: Reply with quote

hello U.Tews i have do it as you say but i get popup page and this what is writing in the page but nothing more


Smarty Debug Console
included templates & config files (load time in seconds)

no templates included
assigned template variables
{$SCRIPT_NAME} "/index.php"
{$account} true
{$content} "<h1></h1> <p></p> <p> </p> <p></p..."
{$language} "fr"
{$page} "index"
{$selected_template} "xt_default"
{$show_index_boxes} "true"
{$top_navigation} Array (1)
0 => Array (2)
name => "Page d'accueil"
url => "http://www.supermarchebeka.com/index...."
{$tpl_path} "/templates/xt_default/"
{$tpl_url_path} "http://www.supermarchebeka.com/templa..."
assigned config file variables (outer template scope)
{#files#} Array (0)
{#vars#} Array (0)

thanks for your help and sorry if i ask allot i just want learn and fix this problem
Back to top
View user's profile Send private message
smsm2000
Smarty Rookie


Joined: 15 May 2012
Posts: 6

PostPosted: Mon May 21, 2012 4:05 pm    Post subject: Reply with quote

hello every one thanks for all who try to help me and U.Tews for you helping me now i found the solution and i will post it here to people who will search after for this problem so the solution to hide boxes in xt commerce or and item or element is this code

{if $page == 'index'}
<div id="yourid">
{box name=yourboxname}
</div>
{/if}

and work with elements not only boxes thanks for all
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP