0

I am creating a custom Item Style for a Content Query Web Part that I am working on. So far I can get all the information from the different fields, but the Choice type fields are not displaying any information.

Is there any specific handling for this field type? I am working in SP2010.

So far I modified my webpart, to specify the fields in the CommonViewFields property (Meeting as internal column name, Choice type):

<property name="CommonViewFields" type="string">Meeting, Choice</property>

Then in the ItemStyle.xsl I created my custom xsl template:

<xsl:template name="MyStyle" match="Row[@Style='MyStyle']" mode="itemstyle">
        <html>
            <table>
                <tr>
                    <td><div class="item"><xsl:value-of select="@Meeting" /></div></td>
                </tr>
            </table>
        </html>
    </xsl:template>

It works for any field type that I have used except Choice. Do I need to modify something else? Thanks.

1 Answer 1

0

From what I know is that single-valued CHOICE fields are returning data also as Text, not needed to process it as Choice. Have you tried looking at your field definition with tools such as SharePoint Manager and make sure indeed it is as such (of course at all times InternalName is what matters). Tried that?

Also, are you using by any change Multi-valued choice fields (which should also work, but exposing data with Separators, usually ;).

2
  • Changing the property to <property name="CommonViewFields" type="string">Meeting, Text</property> does not make it either. I am using a single valued choice field. Sep 24, 2015 at 10:39
  • 1. You did checked the InternalName and it matches (e.g. try avoiding potentially "reserved" names when naming your fields)? 2. Would you expect any special characters (e.g. @) as returned from results that could maybe mess-up the transformation? Also, try changing this fields type (simple types allow it) and see if that fixes Sep 24, 2015 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.