Remove Fields from Custom Content Query Web Part
-
20-10-2020 - |
Solution
- Edit the Content Query web part .
- Get the selected Custom Style Name at Presetnation > Style > Item Style.
- via SharePoint Designer > Open your Root site.
- Go to all files >
Style library
>XSL Style Sheets
>ItemStyle.xml
- Create a copy from
ItemStyle.xml
to allow rollback then > Edit it as advanced mode.
Find the currently selected item style name > check the Variables and styles that corresponded to your fields in your custom style > remove it.
Save > Check In > Publish as Major Version.
- After you finish > go to your QCWP > Edit it > and select your custom style from Presentation > Styles > Item Style > it'should be now removed.
[Suggestion]
Instead of modifying the current item style I suggest to you to create a new item style as the following:
- Paste the following code at the end of
ItemStyle.xml
file before</xsl:stylesheet>
- Change the style
class="item link-item"
as your old one
<xsl:template name="DiscOnly" match="Row[@Style='DiscOnly']" mode="itemstyle"> <div class="item link-item"> <xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/> <div class="description"> <xsl:value-of select="@Description" /> </div> </div> </xsl:template>
Save > Check In > Publish as Major Version. - After you finish > go to your QCWP > Edit it > and select your custom style from Presentation > Styles > Item Style > the OutPut should be like this.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange