2

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?

1 Answer 1

2

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

5
  • Can we add the Web Part Property with the Content Query Web Part, If yes Please provide me answer sharepoint.stackexchange.com/questions/197550/…
    – Ram
    Commented Oct 21, 2016 at 13:25
  • are you need to add a new field at fields to display section ? or new custom property ? Commented Oct 21, 2016 at 13:41
  • New Custom Property with content query.
    – Ram
    Commented Oct 21, 2016 at 13:42
  • #M.Qassas, Can you please let me know the path.
    – Ram
    Commented Oct 25, 2016 at 7:06
  • Dear @Ram, I am sorry for late reply , but really I didn't do this before for a content query web part, I did it only for custom web part, and as you see in this thread it's related to displayed fields at item style, meanwhile , I am trying to find any solution since you communicate with me , once I got it I will inform you :) , Hope you get your solution ASAP :) Commented Oct 25, 2016 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.