我有一个模块Askit
,位于以下目录
/var/www/html/app/design/frontend/base/default/template/tm/askit/
form.phtml页面包含在以下目录中
/var/www/html/app/design/frontend/base/default/template/tm/askit/question/form.phtml
我想更新其布局xml以设置其phtml页面的元数据。
正如我所指的那样this question
我想从我的主题local.xml文件
为上面的页面设置meta这里是布局xml目录url -
/var/www/html/app/design/frontend/argento/mall/layout
我在我的主题布局local.xml文件中编写了以下代码,但它没有更新此页面的元数据 -
<askit_question_index>
<reference name="head">
<action method="setTitle"><value>Ask an Expert and Get Answers - </value></action>
<action method="setDescription"><value>Ask a question and get an answer to your question from a Expert related to your purchased product </value></action>
</reference>
</askit_question_index>
答案 0 :(得分:0)
根据上面提到的代码,它主要应该来自local.xml。但如果不是,您可以通过控制器添加元信息。
在调用indexAction
QuestionController
($this->loadLayout(); and $this->loadLayout();
)中
$headBlock = $this->getLayout()->getBlock('head');
if ($headBlock){
$headBlock->setTitle($this->__('Ask an Expert and Get Answers'));
$headBlock->setDescription($this->__('Ask a question and get an answer to your question from a Expert related to your purchased product'));
$headBlock->setKeywords($this->__('Meta keywords here'));
}