|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
linksfor Smarty n00b
Joined: 17 Jul 2010 Posts: 3
|
Posted: Sat Jul 17, 2010 10:32 am Post subject: collapsible smarty template - need big help! |
|
|
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 |
|
Saeid Smarty Rookie
Joined: 21 Jun 2010 Posts: 25
|
Posted: Sun Jul 18, 2010 1:38 am Post subject: |
|
|
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 |
|
linksfor Smarty n00b
Joined: 17 Jul 2010 Posts: 3
|
Posted: Sun Jul 18, 2010 10:07 am Post subject: |
|
|
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.
|
|
Back to top |
|
|
|
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
|