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

collapsible smarty template - need big help!

 
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
linksfor
Smarty n00b


Joined: 17 Jul 2010
Posts: 3

PostPosted: Sat Jul 17, 2010 10:32 am    Post subject: collapsible smarty template - need big help! Reply with quote

Hi,

I am newby on smarty development, so I hope your help here. I am web designer not programmer, so now i am producing template for Prestashop ecommerce .

Problems:

1. There are three columns layout with fixed width. 190px - 600px -190px (left - main -right).
2. if one column disapear how to calculate width of column automatically?


So i need to do these columns collapsible like on Joomla. For example: if left column empty there are displaying only two or columns and so on.

here is the code of .tpl file:


<!-- Content -->

<div id="columns">
<div class="main"> <div id="left_column" class="column">
{$HOOK_LEFT_COLUMN} //*---how to set column width calculation here? example: <div style="width: ['width']; %"> --*//
</div>
<!-- Center -->

<div id="center_column">
{if !$content_only}
</div>

<!-- Right -->
<div id="right_column" class="column">
{$HOOK_RIGHT_COLUMN} /*--how to hide this column if empty here?--*/
</div>
</div>

Many thanks for help
Back to top
View user's profile Send private message
Saeid
Smarty Rookie


Joined: 21 Jun 2010
Posts: 25

PostPosted: Sun Jul 18, 2010 1:38 am    Post subject: Reply with quote

I guess you have to do that with java script. to hide, but if the variable you want to show is empty, check it with a {if} command:

Code:

{if !$HOOK_RIGHT_COLUMN=""}
<!-- Right -->
<div id="right_column" class="column">
{$HOOK_RIGHT_COLUMN}
</div>
{/if}
</div>



P.S: I am not sure if my {if} syntax is correct, just check the smarty manual.
Back to top
View user's profile Send private message Visit poster's website
linksfor
Smarty n00b


Joined: 17 Jul 2010
Posts: 3

PostPosted: Sun Jul 18, 2010 10:07 am    Post subject: Reply with quote

Saeid wrote:
I guess you have to do that with java script. to hide, but if the variable you want to show is empty, check it with a {if} command:

Code:

{if !$HOOK_RIGHT_COLUMN=""}
<!-- Right -->
<div id="right_column" class="column">
{$HOOK_RIGHT_COLUMN}
</div>
{/if}
</div>



P.S: I am not sure if my {if} syntax is correct, just check the smarty manual.


Yes this is true. this code works well. Thanks for reply.



Very Happy
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