Content Query WebPart Examining Fields Available to Use


To examine the fields available within CQWP (Content query webpart) have this snippet available within your template:

e.g.

<xsl:template name="WMCustom" match="Row[@Style=‘WMCustom’]" mode="itemstyle">

<xsl:for-each select="@*"> 
    <xsl:value-of select="name()" />
</xsl:for-each>

To Print everything around the fields:

<xsl:for-each select="@*">
            <xsl:value-of select="name()"/><xsl:value-of select="." />
        </xsl:for-each>

<xsl:for-each select="@*">
  <br/>
  Name:<xsl:value-of select="name()"> </xsl:value-of>  Value:
  <xsl:value-of select="."></xsl:value-of>
</xsl:for-each>

When you have this above piece of code, the output would be something similar to:

You need to fish out the column name with known data, for example I know this item in list has a value “Amber” for status

ListId{D926A3A4-96F2-42E2-B640-994A7E2A5C76}WebId{96657F9F-CEE9-4903-9994-AA50173CDE20}ID1_x007B_fa564e0f_x002D_0c70_x002D_4ab9_x002D_b863_x002D_0177e6ddd247_x007D_Find a file_x007B_94f89715_x002D_e097_x002D_4e8b_x002D_ba79_x002D_ea02aa8b7adb_x007D_sites/WMHHS01/OfficeofCE/SPO/Project1/Lists/Project Summary/1_.000_x007B_1d22ea11_x002D_1e32_x002D_424e_x002D_89ab_x002D_9fedbadb6ce1_x007D_1_x007B_28cf69c5_x002D_fa48_x002D_462a_x002D_b5cd_x002D_27b6f9d2bd5f_x007D_2014-09-08 16:11:02_x007B_1df5e554_x002D_ec7e_x002D_46a6_x002D_901d_x002D_d85a3881cb18_x007D_Haylee Fox_x007B_d31655d1_x002D_1d5b_x002D_4511_x002D_95a1_x002D_7a09e9b75bf2_x007D_Haylee Fox_x007B_8c06beca_x002D_0777_x002D_48f7_x002D_91c7_x002D_6da68bc07b69_x007D_2014-09-08 13:02:08_x007B_30bb605f_x002D_5bae_x002D_48fe_x002D_b4e3_x002D_1f81d9772af9_x007D_0_x007B_ba3c27ee_x002D_4791_x002D_4867_x002D_8821_x002D_ff99000bac98_x007D_0x400000300c231061_x007B_c5c4b81c_x002D_f1d9_x002D_4b43_x002D_a6a2_x002D_090df32ebb68_x007D__x007B_8fca95c0_x002D_9b7d_x002D_456f_x002D_8dae_x002D_b41ee2728b85_x007D__x007B_39360f11_x002D_34cf_x002D_4356_x002D_9945_x002D_25c44e68dade_x007D__x007B_543bc2cf_x002D_1f30_x002D_488e_x002D_8f25_x002D_6fe3b689d9ac_x007D__x007B_43bdd51b_x002D_3c5b_x002D_4e78_x002D_90a8_x002D_fb2087f71e70_x007D_1_x007B_9da97a8a_x002D_1da5_x002D_4a77_x002D_98d3_x002D_4bc10456e700_x007D__x007B_d83a244e_x002D_e318_x002D_485e_x002D_b7fa_x002D_4a805041379c_x007D_Haylee Fox_x007B_0ab9ab33_x002D_4988_x002D_4786_x002D_9808_x002D_e5f24a488a7b_x007D_Amber_x007B_4ea8f163_x002D_c004_x002D_4fb2_x002D_a59f_x002D_7e33b8a46fc7_x007D_2014-09-08 00:00:00_x007B_b9e6f3ae_x002D_5632_x002D_4b13_x002D_b636_x002D_9d1a2bd67120_x007D__x007B_197cd0f9_x002D_80e7_x002D_4f87_x002D_83d7_x002D_9575e79ec29e_x007D_0.250000000000000_x007B_691b9a4b_x002D_512e_x002D_4341_x002D_b3f1_x002D_68914130d5b2_x007D_PubDateMon, 08 Sep 2014 06:11:02 GMTFileExtensionFileSizeDocumentIconImageUrl/_layouts/15/IMAGES/icgen.gifTitleFind a fileStreamLeadHaylee FoxLinkUrlhttps://healthqld.sharepoint.com/sites/WMHHS01/OfficeofCE/SPO/Project1/Lists/Project Summary/1_.000StylewmrollupstyleGroupStyleDefaultHeader__begincolumnFalse__begingroupFalse

now to use status column you need to grab the green highlighted column in front of the Amber value and use it as below:

<xsl:value-of select="@_x007B_0ab9ab33_x002D_4988_x002D_4786_x002D_9808_x002D_e5f24a488a7b_x007D_"/>