How to add meta description in hybris?

2019-08-26 22:55发布

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

1条回答
2楼-- · 2019-08-26 23:06

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);
}
查看更多
登录 后发表回答