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

sidebar

 
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 -> Frameworks
View previous topic :: View next topic  
Author Message
fardamm
Smarty Rookie


Joined: 20 Jun 2012
Posts: 5

PostPosted: Wed Jun 20, 2012 1:39 pm    Post subject: sidebar Reply with quote

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
View user's profile Send private message Send e-mail
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Jun 21, 2012 3:05 pm    Post subject: Reply with quote

That would probably be a CSS/stylesheet thing to work out, not really Smarty specific.
Back to top
View user's profile Send private message Visit poster's website
fardamm
Smarty Rookie


Joined: 20 Jun 2012
Posts: 5

PostPosted: Thu Jun 21, 2012 3:23 pm    Post subject: sidebar Reply with quote

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
View user's profile Send private message Send e-mail
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Jun 21, 2012 3:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
fardamm
Smarty Rookie


Joined: 20 Jun 2012
Posts: 5

PostPosted: Thu Jun 21, 2012 3:47 pm    Post subject: sidebar Reply with quote

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
View user's profile Send private message Send e-mail
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Thu Jun 21, 2012 4:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
fardamm
Smarty Rookie


Joined: 20 Jun 2012
Posts: 5

PostPosted: Thu Jun 21, 2012 5:06 pm    Post subject: sidebar happy Reply with quote

Dear admin,
I am happy with your explanation. Thanks a lot for your time.
Have good time.
Best Regards
Back to top
View user's profile Send private message Send e-mail
fardamm
Smarty Rookie


Joined: 20 Jun 2012
Posts: 5

PostPosted: Thu Jun 28, 2012 3:48 pm    Post subject: sibebar problem solved Reply with quote

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
View user's profile Send private message Send e-mail
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 -> Frameworks 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