How to add meta description in hybris?

泄露秘密 提交于 2019-12-02 11:14:25

问题


screen shotI can see the place where I can add meta title but unable to see any meta description column.


回答1:


You can debug the ProductPageController there you can see how metaDescription being set. In Hybris OOTB(I'm referring 6.7), meta description being set using product description. So you need to check the same in your codebase. If you haven't customized that part so far then tries setting product description and check.

ProductPageController

final String metaKeywords = MetaSanitizerUtil.sanitizeKeywords(productData.getKeywords());
final String metaDescription = MetaSanitizerUtil.sanitizeDescription(productData.getDescription());
setUpMetaData(model, metaKeywords, metaDescription);

AbstractPageController

protected void setUpMetaData(final Model model, final String metaKeywords, final String metaDescription)
{
    final List<MetaElementData> metadata = new LinkedList<>();
    metadata.add(createMetaElement("keywords", metaKeywords));
    metadata.add(createMetaElement("description", metaDescription));
    model.addAttribute("metatags", metadata);
}


来源:https://stackoverflow.com/questions/55907801/how-to-add-meta-description-in-hybris

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