|
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 |
nosenc Smarty Rookie
Joined: 30 Sep 2014 Posts: 7
|
Posted: Tue Sep 30, 2014 10:17 am Post subject: smarty.block.parent on a specific line |
|
|
Hey people.
Im new to smarty and I need a little help with my code. I have removed a checkbox in a <td></td> with $smarty.block.parent.
Now I want to do the same with a <p> within another <td></td> which is the 4th <td> in the div
Current code:
Code: | [{if $basketitem->getdBundledAmount() > 0 && ($basketitem->isBundle() || $basketitem->isDiscountArticle()) }]
[{if $editable }]
<td> </td>
[{/if}]
[{else}]
[{$smarty.block.parent}]
[{/if}] |
Basically, all I want to know is how to structure the html elements within the code to achieve this.
Code: | [{if $basketitem->getdBundledAmount() > 0 && ($basketitem->isBundle() || $basketitem->isDiscountArticle()) }]
[{if $editable }]
<td> </td> <-- this works
<td></td>
<td></td>
<td><p> </p></td> <-- this doesnt work / I only want to change the <p>
[{/if}]
[{else}]
[{$smarty.block.parent}]
[{/if}] |
I obviously cant do this like in the code above. I dont want to touch anything except the fields where I have placed  :
Greetz
Last edited by nosenc on Wed Oct 01, 2014 8:49 am; edited 3 times in total |
|
Back to top |
|
nosenc Smarty Rookie
Joined: 30 Sep 2014 Posts: 7
|
Posted: Tue Sep 30, 2014 3:37 pm Post subject: |
|
|
No ideas? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Sep 30, 2014 11:02 pm Post subject: |
|
|
In the normal use of template inheritance {block}{/block} sections of child templates do replace correponding sections in parent templates. without knowing the {block}{/block} structure of your child and parent templates it's difficult to understand what you want to do.
{$smarty.block.parent} can only be used within a {block}{/block} section of a child template. It does reference the correponding section in the parent template.
Please provide more information about your template structure. |
|
Back to top |
|
nosenc Smarty Rookie
Joined: 30 Sep 2014 Posts: 7
|
Posted: Wed Oct 01, 2014 8:50 am Post subject: |
|
|
I have edited my second code for better understanding. I just want to change whats within the <p> |
|
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
|