Alright, the capture method worked beautifully. For example...
[{capture name="block_parent" assign="blk_prnt"}]
> [{$smarty.block.parent}]
> [{/capture}]
> [{capture name="block_new" assign="blk_new"}]
> [new content goes here...]
> [{/capture}]
>
> [{$blk_prnt|regex_replace:"[regex expression...]/s":$blk_new}]
>
With this, you can manipulate or remove whatever pieces of the parent you
want. For example, I used it to remove the out-most <td> tags, insert the
new content, and then added back the <td> tags.
Thx again for the tip.
Shaun.
On Fri, Mar 16, 2012 at 8:28 AM, Shaun Purvis <[email protected]>wrote:
> Thanks, I'll try with [{capture}]. I guess whether it works will depend
> on when the placeholder is replaced.
>
> IMO, the root issue I encountered was poor placement of the [{block}] tag
> which is placed around <td> tags rather than inside where all the content
> is. I don't think there's much somebody would want to change outside of
> the cell. See the checkout_basketcontents_basketitem_* blocks for example
> (within the basketcontents.tpl). I just want to add some more article info
> to one of the cells, but have to replace the entire block to do this. Had
> the [{block}] been w/i the <td>, I could have just extended the content.
> The same applies to all the other cells in basket table as well.
>
> Is the [{block}] really good for much outside of the <td> tag? Sure, you
> could remove the entire cell, but you'd have to edit the template anyways
> to remove the header <th> tags.
>
> Shaun.
>
>
> On Fri, Mar 16, 2012 at 6:22 AM, Kai Gazmaga
> <[email protected]>wrote:
>
>> Would it be possible to make it a variable in future versions? This would
>> extend functionality by 100% I think!
>>
>> Regards, Kai
>>
>>
>> ----------------------------------------------------------------------------------------------------
>> *Vektor*Design - Online-Shops und Programmierung
>>
>> Kai Gazmaga
>> Katharinenstraße 57
>> 73 728 Esslingen
>>
>> Tel.: +49 711 - 25516226
>> Fax: +49 711 - 25518078
>>
>> Mail: [email protected]
>> Web: www.vektordesign.de
>>
>>
>>
>> 2012/3/16 Rimvydas Paskevicius <[email protected]>
>>
>>> Hi,
>>>
>>> It’s not possible to manipulate on [{$smarty.block.parent}] as it is
>>> not variable, just a placeholder. When block file is parsed, this
>>> [{$smarty.block.parent}] is replaced by parent blocks content using regexp.
>>>
>>>
>>> Rimvydas
>>>
>>>
>>>
>>> *From:* Shaun Purvis <[email protected]>
>>> *Sent:* Friday, March 16, 2012 1:35 AM
>>> *To:* [email protected]
>>> *Subject:* [oxid-dev-general] Possible to manipulate parent block
>>>
>>> When overriding tpl blocks, the original parent block can be inserted
>>> with [{$smarty.block.parent}]. I was hoping to manipulate this variable,
>>> but haven't had any success. I'm starting to think it has some special
>>> treatment. I tried something like
>>>
>>> [{$smarty.block.parent|regex_replace:"</td>":"</td><new tag...>"}]
>>>
>>> But it didn't render. No luck with other modifiers either so it seems
>>> it cannot be modified.
>>>
>>> I'm trying to avoid replacing the entire block for the sake of
>>> maintenance. Has anybody ever tried to modify the $smarty.block.parent
>>> variable, or know if it's even possible?
>>>
>>> Shaun.
>>>
>>> ------------------------------
>>> _______________________________________________
>>> dev-general mailing list
>>> [email protected]
>>> http://dir.gmane.org/gmane.comp.php.oxid.general
>>>
>>>
>>> _______________________________________________
>>> dev-general mailing list
>>> [email protected]
>>> http://dir.gmane.org/gmane.comp.php.oxid.general
>>>
>>
>>
>> _______________________________________________
>> dev-general mailing list
>> [email protected]
>> http://dir.gmane.org/gmane.comp.php.oxid.general
>>
>
>
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general