Dismiss Notice

Register now to be one of the first members of this SharePoint Community! Click here it just takes seconds!

Dismiss Notice
Welcome Guest from Country Flag

Custom CQWP - Checking if slot value is set

Discussion in 'SharePoint Blogs' started by /u/forgotusername, Mar 10, 2016.

Thread Status:
Not open for further replies.
  1. /u/forgotusername

    /u/forgotusername Guest

    Blog Posts:
    0
    I have a custom CQWP which generates a table based off of the set slots ("Fields to Display"). When generating the cells for each row, I am trying to evaluate whether a value exists in a particular slot.

    For example, let's say one of the slots is called "TextColumn" and I have that set to get information from the "Description" column. In the template located in the ItemStyle.xsl file, I have "<xsl:if test="string-length(@TextColumn) != 0">" which will generate the td element and the value set in the Description field for the item.

    This mostly works. However, if I have a list where some items have descriptions and others don't, the table doesn't come out right. This is because it is evaluating the Description field of that particular item and, if there isn't a Description set, it doesn't spit out the td elements needed.

    So, basically, instead of evaluating the description column of that particular item, can I instead evaluate whether something has been set for the "TextColumn" slot?

    Thanks.

    submitted by /u/forgotusername
    [link] [comments]

    Continue reading...
     
Thread Status:
Not open for further replies.

Share This Page

LiveZilla Live Chat Software