Simian Design

Tony Stephens in his corner of the web.
minimize

Sharepoint Content Queries

Three quick tips/points. In Sharepoint 2007 the Content Query is an incredibly powerful tool. It’s a webpart that basically allows you to query your site and it returns an XML stream that you can then style the XSL for using the ItemStyle.xml.

By combining the Itemstyle.xml and Site Columns you create some real power. Maybe at some point in the future I’ll write more about what I’ve found with these two things.

But some quick notes and tips (because these lists are quicker and easier for me to write up rather than a real actual article or post, with real sentences, etc.)

  1. DO NOT USE SPACES in your Site Columns. Just avoid it. There is no reason. It causes problems when you’re extending the CommonFields property in the Exported Webpart to use with the Itemstyle. CamelCase it then you can rename the column. The source column name will stay CamelCased.
  2. Speaking of the CommonFields property in the Exported Webpart, here is the list of Field Types I use:
    1. Text
    2. Note
    3. Number
    4. Currency
    5. Integer
    6. Boolean
    7. DateTime
    8. Threading
    9. Lookup
    10. Choice
    11. URL
    12. Counter
    13. RichHTML
    14. Image
  3. In your ItemStyle.xsl, add the following as your last property. When chosen it’ll show you all the fields the part is pulling in.  (Brackets and code view taken off as it was causing weirdness with my Wordpress installation, and I’m not in the position to spend a ton of time looking at why right now.)
    xsl:for-each select=”@*”
    Property: xsl:value-of select=”name()”
    xsl:for-each

Leave a Reply