View previous topic :: View next topic |
Author |
Message |
fardamm Smarty Rookie
Joined: 20 Jun 2012 Posts: 5
|
Posted: Wed Jun 20, 2012 1:39 pm Post subject: sidebar |
|
|
Hello,
Will you please tell me how can I use smarty to hide sidebar(s) from some pages which need more space?
Best regards |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Jun 21, 2012 3:05 pm Post subject: |
|
|
That would probably be a CSS/stylesheet thing to work out, not really Smarty specific. |
|
Back to top |
|
fardamm Smarty Rookie
Joined: 20 Jun 2012 Posts: 5
|
Posted: Thu Jun 21, 2012 3:23 pm Post subject: sidebar |
|
|
Hello, Thanks a lot for your reply.
m templates are already done, using css/ smarty, but it's table-based .
Now I am editing templates using div only without table.
There are many smarty tags (?), I am new with smarty and I don't know how to deal with.
My main problem now is that the new template is consisted of two sidebar, but some pages need more space so sidebars should be hided.
Will you please tell me where is the related topic in smarty to review , may be I can find a solution for my problem.
Very appreciate your kind reply.
Best regards
www.fctio.com |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Jun 21, 2012 3:27 pm Post subject: |
|
|
Well again, this would be a template design issue, not something directly related to Smarty. Smarty does not have plugins that create sidebars. Smarty only displays the HTML/CSS/JS you put in the template.
So the answer is to inspect the HTML/CSS/JS that generates your sidebars, and decide how you want to adjust this to make your sidebar hide. Depending on how you have things setup, this may be as simple as setting the display property to "none" on a tag (such as <div>) that encapsulates the sidebar. |
|
Back to top |
|
fardamm Smarty Rookie
Joined: 20 Jun 2012 Posts: 5
|
Posted: Thu Jun 21, 2012 3:47 pm Post subject: sidebar |
|
|
Hello,
Dear Admin,
Thank you so much for prompt reply.
According to your explanaion, I am in a wrong place. I should search in css tags for my problem.
Just for your informatoin.
Index file:
<div class="sth">{include file="sidebar.html"} </div>
so the page will be appeared with sidebar.
in the page in question there is no option to hide sidebar.
there is also :
{if $OFFSIDEBAR}
{include file="alert.html"}
{include file="{$BOXCONTENTS}.html"}
{else}
{include file="alert.html"}
{include file="{$BOXCONTENTS}.html"}
{/if}
in index file
------------------------------------ |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Thu Jun 21, 2012 4:28 pm Post subject: |
|
|
Yes these {include ...} statements are just Smarty including templates within one another. You need to decide how your logic will work to hide/unhide the sidebar. Something in JS/CSS will probably be a good approach. ie. javascript toggle button that hides/unhides the "sth" div. Google for "hide a div with javascript toggle" |
|
Back to top |
|
fardamm Smarty Rookie
Joined: 20 Jun 2012 Posts: 5
|
Posted: Thu Jun 21, 2012 5:06 pm Post subject: sidebar happy |
|
|
Dear admin,
I am happy with your explanation. Thanks a lot for your time.
Have good time.
Best Regards |
|
Back to top |
|
fardamm Smarty Rookie
Joined: 20 Jun 2012 Posts: 5
|
Posted: Thu Jun 28, 2012 3:48 pm Post subject: sibebar problem solved |
|
|
Hi,
I finally solved the problem:
I put this condition before the div of page that I want it without sidebar :
{if $OFFSIDEBAR}
{include file="alert.html"}
{include file="{$BOXCONTENTS}.html"}
and put this condition for the div of page in question :
{else}
<div page in question without sidebar>
{include file="alert.html"}
{include file="{$BOXCONTENTS}.html"}
</div>
{/if}
that's it .
Regards |
|
Back to top |
|
|