开发者

Why does Magento overwrite my keywords

开发者 https://www.devze.com 2023-03-13 11:30 出处:网络
I have a weird problem. Within a template (phtml) I s开发者_开发知识库et Keywords via $this->getLayout()->getBlock(\'head)->setKeywords(\'bla, bla, bla\');

I have a weird problem. Within a template (phtml) I s开发者_开发知识库et Keywords via

$this->getLayout()->getBlock('head)->setKeywords('bla, bla, bla');

In an other .phtml from another block, which is rendered afterwards, I still have the keywords (checked in debugging with ... ->getKeywords()).

But, when the page is fully rendered, the keywords are set to the default ones. I just debugged through the whole process until renderLayout() is finished, but I can't find the line, where the keywords are set to default..

Does someone know any workaround ?


Looks like you are missing a closing quote around 'head'. Should be:

$this->getLayout()->getBlock('head')->setKeywords('bla, bla, bla');
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号