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

smarty.block.parent on a specific line

 
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
nosenc
Smarty Rookie


Joined: 30 Sep 2014
Posts: 7

PostPosted: Tue Sep 30, 2014 10:17 am    Post subject: smarty.block.parent on a specific line Reply with quote

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

Current code:

Code:
[{if $basketitem->getdBundledAmount() > 0 && ($basketitem->isBundle() || $basketitem->isDiscountArticle()) }]
   [{if $editable }]
      <td>&nbsp;</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>&nbsp;</td> <-- this works
      <td></td>
      <td></td>
      <td><p>&nbsp;</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 &nbsp:

Greetz


Last edited by nosenc on Wed Oct 01, 2014 8:49 am; edited 3 times in total
Back to top
View user's profile Send private message
nosenc
Smarty Rookie


Joined: 30 Sep 2014
Posts: 7

PostPosted: Tue Sep 30, 2014 3:37 pm    Post subject: Reply with quote

No ideas? Confused
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Sep 30, 2014 11:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
nosenc
Smarty Rookie


Joined: 30 Sep 2014
Posts: 7

PostPosted: Wed Oct 01, 2014 8:50 am    Post subject: Reply with quote

I have edited my second code for better understanding. I just want to change whats within the <p>
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