开发者

CQWP - How to force CommonViewFields to display all fields

I'm using a CQWP(Content query web part) that fetch a calendar list and I want to filter my result (customqueryoverride - usign CAML). However, some fields from the calendar list are hidden to me.

I want to know all fields in my calendar list开发者_如何学JAVA.

The solution I came up with was to use an identity transform XSL to display all my properties and their values and adding all fields to the CommonViewFields property.

<property name="CommonViewFields" type="string">
  EventDate,DateTime;EndDate,DateTime;fRecurrence,Boolean
</property> 

The issue I have is that I dont know the field name... Any wildcard I could use?(%%% and *** didn't work) Any other way of getting all the fields name would work too.

Note: It's to understand and play with recurrent events.


Use the SharePoint 2010 Manager (http://spm.codeplex.com/) tool. It gives you a plethora of details about your SharePoint platform at all levels, right down to the fields in a list. It will give you all the field details, including the internal name you need to use for CommonViewFields.


To print all available field names in CQWP the following XSLT could be used:

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

It should be placed in ItemStyle.xsl inside template that is used to item rendering.


Use tag for this, comment the main template in main XSL and add this as template match="/":

<xsl:template match="/ ">  
<textarea cols="50" rows="15" dir="ltr">
   <xmp><xsl:copy-of select="*"/></xmp> 
</textarea>

Now the CQWP will display the full query response XML

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜