Question

In SharePoint 2013, I have a Pages library full of press releases. A press release page layout contains the following: Title, Article Date, Contact Name, Contact E-mail Address, Page Content.

On the homepage, I want to display the 10 most recent press releases and only display Title, Article Date and Page Content.

The custom Content Query Web Part has Title and Description fields I can use for Title and Page Content. How do I add the field for Article Date?

Était-ce utile?

La solution

You should create/modify the itemStyle for your CQWP with your custom field like AreticleDate.

Steps:

  • Open your Root site via SharePoint Designer.
  • Go to all files > Style library > XSL Style Sheets > ItemStyle.xml
  • Create a copy from ItemStyle.xml then > Edit it as advanced mode.

enter image description here

  • Find the currently selected item style name > at any appropriate place in this template add

enter image description here

<div class="article-date">
<xsl:value-of select="@ArticleDate" />
</div>
  • 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.

enter image description here

  • Bind the fields to display based on your fields in your page.

See also :- Displaying Custom Fields in a SharePoint 2013 Content Query Web Part

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top