View previous topic :: View next topic |
Author |
Message |
smsm2000 Smarty Rookie
Joined: 15 May 2012 Posts: 6
|
Posted: Tue May 15, 2012 11:42 pm Post subject: help in xt:commerce |
|
|
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 |
|
adn Smarty Regular
Joined: 31 May 2011 Posts: 91
|
Posted: Wed May 16, 2012 8:31 am Post subject: |
|
|
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 |
|
ChrisFah Smarty Pro
Joined: 02 Nov 2009 Posts: 159 Location: Traun, Austria
|
Posted: Wed May 16, 2012 8:10 pm Post subject: |
|
|
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 |
|
smsm2000 Smarty Rookie
Joined: 15 May 2012 Posts: 6
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat May 19, 2012 9:52 am Post subject: |
|
|
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 |
|
smsm2000 Smarty Rookie
Joined: 15 May 2012 Posts: 6
|
Posted: Sat May 19, 2012 1:29 pm Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat May 19, 2012 1:40 pm Post subject: |
|
|
insert a {debug} tag in your template and check the value of $show_index_boxes |
|
Back to top |
|
smsm2000 Smarty Rookie
Joined: 15 May 2012 Posts: 6
|
Posted: Sat May 19, 2012 2:07 pm Post subject: |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun May 20, 2012 9:22 am Post subject: |
|
|
Insert {debug} on top of the template file(s) where you test $show_index_boxes |
|
Back to top |
|
smsm2000 Smarty Rookie
Joined: 15 May 2012 Posts: 6
|
Posted: Sun May 20, 2012 2:42 pm Post subject: |
|
|
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 |
|
smsm2000 Smarty Rookie
Joined: 15 May 2012 Posts: 6
|
Posted: Mon May 21, 2012 4:05 pm Post subject: |
|
|
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 |
|
|