1

我正在使用Hippo CMS

在使用HST SEO support plugin失败后,我意识到这HstResponse::addHeadElement对我的 HTML 页面没有任何影响。

例如,在组件代码中添加以下行时:

Element title = response.createElement("title");
title.setTextContent("Foo");
response.addHeadElement(title, "hst.seo.document.title");

我希望<title>Foo</title>响应中包含相应的标记,但事实并非如此。

我错过了什么?

4

1 回答 1

1

hst:headContributions问题是我在布局文件中没有合适的节点。

我有两个用于两个不同的类别:

<hst:headContributions xhtml="true" categoryIncludes="headerNav" />

<hst:headContributions xhtml="true" categoryIncludes="styles" />

但该插件不使用任何类别作为其头部贡献。

在我的 JSP 模板中添加以下行修复了该问题:

<hst:headContributions xhtml="true" categoryExcludes="headerNav,styles" />
于 2014-02-28T11:46:45.910 回答