我试图从我的sharepoint讨论板显示我的主页上的最新帖子?

时间:2014-04-05 12:31:48

标签: sharepoint web sharepoint-2013 sharepoint-designer

我有一个带讨论区的社区网站,我想在我的主要启动页面上显示一些最新帖子?

如何在SharePoint 2013中实现它?

2 个答案:

答案 0 :(得分:1)

建议的解决方案允许修改UI中无法使用的讨论列表Web部件属性。

启用Web部件导出功能

为了修改UI中不可用的Web部件属性,我们需要启用导出功能:

  • 在页面上添加讨论列表。
  • 在SharePoint Designer(SPD)中打开页面
  • 找到属性ExportControlledProperties并设置其值 到True以启用Web部件导出功能
  • 以SPD格式保存页面

更改Web部件属性

从现在开始,必须提供导出操作,如下图所示 enter image description here

假设我们需要显示最近的4个讨论。

讨论默认视图(Subject)具有以下属性:

<RowLimit Paged="TRUE">20</RowLimit>

要更改这些属性,请按照以下步骤操作:

  • 导出网络部件文件
  • 找到属性XmlDefinition并更改RowLimit元素 Paged属性为FALSE,值为4
  • 上传并添加网页部分

结果

enter image description here


如何使用CQWP显示讨论

为了汇总来自不同站点的讨论,您可以使用内容查询Web部件(CQWP)。

步骤:

  • 添加Content Query网页部分(位于Content Roollup类别下)
  • 转到网页部件设置并指定Query设置,如下图所示 enter image description here
  • 并指定Sorting设置,如图所示 enter image description here

答案 1 :(得分:0)

这是我发现的列表样式,使CQWP正常工作。

<xsl:template name="DiscussionStyle" match="Row [@Style='DiscussionStyle']" mode="itemstyle">
  <xsl:variable name="DisplayTitle">
   <xsl:call-template name="OuterTemplate.GetTitle">
    <xsl:with-param name="Title" select="@Title"/>
    <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
   </xsl:call-template>
 </xsl:variable>
 <table cellpadding="3" cellspacing="3" width="100%">
  <tr>
   <td class="S2StyleTitle" colspan="2">
    <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/>
    <a href="{@LinkUrl}" title="{@LinkToolTip}" style="font-size:11px;">
     <xsl:value-of select="$DisplayTitle"/>
    </a>
   </td>
  </tr>
  <tr class="S2StyleBorder">
   <td class="S2StyleDescription" valign="top">
    <span style="color:#808080"><strong>Posted</strong>:
     <xsl:value-of select="@PubDate"/>
    </span>
   </td>
  </tr>
 </table>
</xsl:template>

How to Configure a Custom Item Style for a Discussion Board using the Content Query Web Part