Janak Chapaneri
Janak Chapaneri

Reputation: 31

How to add meta description in hybris?

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

Upvotes: 2

Views: 1360

Answers (1)

HybrisHelp
HybrisHelp

Reputation: 5810

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

Upvotes: 3

Related Questions