How to pass parameter with block form contents from cms pages in magento

前端 未结 4 2035
别那么骄傲
别那么骄傲 2021-01-04 10:18

I want to pass a variable with the block code like of JSON type in magento,

{{block type=\"multibanners/multibanners\" category_id=\"9\" name=\"multibanners\         


        
4条回答
  •  臣服心动
    2021-01-04 11:03

    I'm not 100% sure what you are asking, but if you are trying to pass a variable to multibanners.phtml from the code above then you could create another attribute similar to category_id="9" and in multibanners.phtml you could get the value using $this->getData("category_id");

    e.g.

    {{block ... my_var="value here" ... template="multibanners/multibanners.phtml"}}
    

    In multibanners.phtml:

    $this->getData('my_var');
    

提交回复
热议问题