Magento - Where to replace the {{...}} placeholders?

I create some custom blocks, and I want to support the {{url = "..."}} functions of the Magento dynamic linker inside the XML update layout.

Example:

<action method="setImageSrc"> <name><![CDATA[{{skin url=images/banners/MyBanner.jpg}}]]></name> </action> 

Inside my block class, I grab variables (i.e. $this->getImageSrc() ), build the HTML, and output it. Unfortunately, this literally prints out {{skin url = "..."}}. Where is this translation done? Is this something that I can just pass to my HTML to clear it before output? If so, how?

NOTE. I tried to use without CDATA, as well as with quotes and without them. Nothing works ... some violate it worse than others

+4
source share
1 answer

Thanks to the information from @clockworkgeek, I figured this out. These 2 resources explain it very well ... besides how to use it.

Syntax Magento CMS

How template tags work

To really use it, is VERY simple. I just created my own _toHtml() method in my special block class as follows:

 public function _toHtml() { $processor = Mage::getModel('core/email_template_filter'); return $processor->filter(parent::_toHtml()); } 
+5
source

Source: https://habr.com/ru/post/1387265/


All Articles