我是 magento 的新手,所以如果我的问题很愚蠢,我深表歉意。
我需要在页面顶部的带有自定义变量的块中显示元描述。这可能吗?
我四处寻找,我认为这篇文章是我应该做的。但我无法让它发挥作用。 帖子链接
这是我在“变量 HTML 值”字段中写的内容:
< ?php $descr = $this->getLayout()->getBlock('head')->getDescription() ; 回显 $descr; ?>
<?php $headBlock = $this->getLayout()->getBlock('head'); echo $description=$headBlock->getDescription(); ?>
请使用此代码