Pergunta

I have added Content query webpart in home page for announcement list.

I have a done changes in XSLT file to show body field. Now I want to add attachment field.

for body i used below code:

<div class="Body">
     <xsl:value-of disable-output-escaping="yes" select="@Body" />
</div>
Foi útil?

Solução

Try below code and see if it works for you:

<xsl:element name="SharePoint:AttachmentsField">
     <xsl:attribute name="runat">server</xsl:attribute>
     <xsl:attribute name="FieldName">Attachments</xsl:attribute>
     <xsl:attribute name="ControlMode">Display</xsl:attribute>
     <xsl:attribute name="Visible">true</xsl:attribute>
     <xsl:attribute name="ItemId">
          <xsl:value-of select="@ID"/>
     </xsl:attribute>
</xsl:element>

Source: Attachments files on Content Query.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top