How to implement Canonical Tag in Pimcore CMS?

喜欢而已 提交于 2020-01-17 00:37:07

问题


I have to implement canonical tags on a customer website which works with Pimcore CMS. Does somebody has experience with that or can give me some hints?


回答1:


If you want to set this tag globally, or with some simple url regex matching, you can do it straight from the admin panel using Marketing > Tag & Snippet Management.




回答2:


A way could be to set a Document Property and render it in your view. see: https://pimcore.com/docs/4.6.x/Development_Documentation/Tools_and_Features/Properties.html

For PHP Templating Engine you could add this line and set it properly in your Backend.

<link rel="canonical" href="<?= $this->document->getProperty('canonicalHref');?>" />


来源:https://stackoverflow.com/questions/49754469/how-to-implement-canonical-tag-in-pimcore-cms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!