如何在hybris中添加元描述? [英] How to add meta description in hybris?

查看:96
本文介绍了如何在hybris中添加元描述?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

屏幕截图我可以看到可以添加元标题但无法添加的地方查看任何元描述列.

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

推荐答案

您可以调试ProductPageController,在那里您可以看到metaDescription的设置方式.在Hybris OOTB(我指的是6.7)中,使用产品描述设置了元描述.因此,您需要在代码库中进行检查.如果您到目前为止尚未自定义该部件,请尝试设置产品说明并进行检查.

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);
}

这篇关于如何在hybris中添加元描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆