SharePoint 2013 Content Query Web Part list from custom XSL file

Here are some quick instructions on how to force a content query web part to allow you to use a custom item style from a .xsl file.

  1. SP Designer: Create your custom item style xsl that displays your list
  2. SP Web: Add a Content Query web part to your page
    1. Open the tool pane to customize
    2. Set the query source
    3. Notice that under Presentation > Styles your custom item style does not show up in the drop down
  3. Export your web part to a local drive
  4. Open the exported .webpart file in a text editor
    1. Search for the following properties and replace each value with a link to your custom item style .xsl location
      1. <property name=”MainXslLink” type=”string”>/sites/myTE/Style Library/XSL Style Sheets/TENewsContentQueryMain.xsl</property>
      2. <property name=”ItemXslLink” type=”string”>/sites/myTE/Style Library/XSL Style Sheets/TENewsItemStyle.xsl</property>
      3. <property name=”HeaderXslLink” type=”string”>/sites/myTE/Style Library/XSL Style Sheets/TENewsHeader.xsl</property>
  5. SP Web: Go to Settings > Site Settings > Web Parts and upload the customized .webpart file
    1. Title is the friendly name
    2. Group is where the web part is grouped when adding web parts to pages
  6. SP Web: Add the new web part to the page and the item style drop down menu should now include the item styles from your custom .xsl file
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s