Skip to end of metadata
Go to start of metadata

The Problem: You have just added a new column to a content type. Authors are adding data to this field but its not showing in your content query webpart. 

Solution: Edit the webpart and XSL to add it. Here is how to do it through Sharepoint Designer

  1. Open the Site Settings > Site Columns view to get the Name of your Site Column, It's not the "title" and it is NOT shown in the UI anywhere. You have to get it from the url.
    Note when you hover over a column, or click it, you will see the word "field=theNameofYourColumn" in the URL. Find this and copy it. In the example below I am hovering over Carousel Hero and the field name at the bottom is "TeaserRichText" this is the word you will need.
  2. The other thing you will need is the type: In the example above it is "Publishing HTML" - but again, that is the title, you need the actual short name (in this case "HTML") here is a list of how they map:
    Type Display
    TaxonomyFieldTypeMulti Managed Metadata
    RatingCount Number of Ratings
    Text Single line of text
    Boolean Yes/No
    Guid Guid
    Choice Choice
    Image Publishing Image
    User Person or Group
    Currency Currency
    URL Hyperlink or Picture
    Note Multiple lines of text
    SummaryLinks Summary Links
    Counter Counter
    Integer Integer
    Number Number
    Lookup Lookup
    Computed Computed
    Integer Integer
    DateTime Date and Time
    Choice Choice
    Number Number
    TaxonomyFieldType Managed Metadata
    Recurrence Recurrence
    HTML Publishing HTML
    File File
    UserMulti Person or Group
    AverageRating Rating (0-5)
    Computed Computed
    ModStat Moderation Status
    AllDayEvent All Day Event
    AllDayEvent All Day Event 11
    CrossProjectLink Cross Project Link

    Source: http://social.technet.microsoft.com/Forums/ar/sharepoint2010programming/thread/8fc8e9df-4e89-42c9-a858-e15c59ca616e
    3. Edit the webpart - Note that the way Sharepoint works, the webpart you see on the page is a copy of the one in the catalog. It is copied WHEN YOU ADD IT TO THE PAGE. If you change it catalog, it will be updated for any NEW webparts added based on this, but existing ones will either need to be added to the page again, or edited individually.
    In Sharepoint Designer open All Files > _catalogs > wp >  yourwebpart.webpart (ours is xwidget.webpart - a modified version of Content Query webpart)
    Find this line in the:
    

    This is where you add the "Column Name, Type;" - adding it here will pass it to the XSL4. Edit the XSL - Your webpart also has a line that calls the correct XSL. it looks like this:
    

    Open that file in Sharepoint Designer. The values from above can transformed, manipulated, or just rendered with the following:

    Notice the @ sign. Others values that are passed as parameters or variables and have a $5. Replace the old webpart with the new ones - remember these are copies on the page, not tied to the original in the catalog. 

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.