0

我不知道我做错了什么,但这让我发疯。

我正在搜索博客站点并显示包含 PostCategory 的帖子。

我已导出 CQWP 并更新了 viewcommonfields 以包括 PostCategory、Lookup

我已编辑 itemlist.xsl 以显示 @PostCategory

当我在单个帖子列表上使用 CQWP 时,会显示 PostCategory(显示以下列表中的项目)。我选择哪个帖子列表似乎并不重要,它工作正常。

一旦我将查询更改为显示来自以下站点和所有子站点的项目或显示来自此集合中所有站点的项目,该类别就不再显示。我尝试在 PostCategory 下的要显示的字段中输入 allsorts,例如 PostCategory、Category、Category [自定义类型],但都无济于事。

我究竟做错了什么?

谢谢

斯图尔特。

4

1 回答 1

0

I'm not able to test it right now by myself, but try to use Guid instead of field name. For example I have similar case, but need to show post title for comment. I use

{a131e489-d3d6-4f0c-a152-a3beb89f12be},Lookup;

in CommonViewFields, and

<xsl:variable name="PostTitle">
    <xsl:value-of select="string(@_x007B_a131e489_x002D_d3d6_x002D_4f0c_x002D_a152_x002D_a3beb89f12be_x007D_)" />
</xsl:variable>

in XSL.

Also you can specify which lists in which sites should be queried by filling 'ListsOverride' and 'WebsOverride' properties of CQWP

http://www.glynblogs.com/2011/06/querying-specific-lists-with-the-content-query-web-part.html

于 2012-03-14T10:19:04.073 回答