Customize the rendering of a List View in Sharepoint 2010: Displaying List Items in Accordion


The creation of non standard presentations for Lists/Libraries  is a fairly common  scenario and using the XSLT List View Web Part (XLV) possibilities that can be achieved pretty easily.
Let’s take a look how to render list of question and answers using Accordion Menu in SharePoint. Actually the idea for this post appeared after posting  of corresponding question on StackOverflow.
So, let’s discuss how it could be accomplished using XLV. For Accordion we will utilize jQuery UI library.



FAQ Custom List

First of all, let us define where  the questions and answers (FAQ) we’ll be stored. For this we will use Custom List with Content Type.

Custom View for arranging items using jQuery UI Accordion

After creating Custom List we add new View for displaying Accordion for FAQ items

XSLT style sheet for rendering Accordion View

XSLT style sheet for FAQ List is intended for the following purposes:

  • loading jQuery Core and UI Libraries
  • rendering list items using layout as specified for Accordion menu
  • initializing and rendering Accordion for List items

Using jQuery UI Accordion

jQuery Core and UI libraries are injected during XSLT style sheet processing. After JavaScript files which hosted on Microsoft CDN are loaded, jQuery UI Accordion is initialized for items.


FAQ List Accordion View rendered in XLV is shown below on picture

FAQ Accordion View


14 thoughts on “Customize the rendering of a List View in Sharepoint 2010: Displaying List Items in Accordion

  1. Pingback: Customize the rendering of a List View in Sharepoint 2013: Displaying List Items in Accordion | Yet Another SharePoint Blog

  2. Hi there, just wanted to say that I’m new to SharePoint development i.e. coded solutions and have downloaded this and tried it and it’s great! Thanks for sharing this.

    • Hi Nicola,

      if it is only intended for this specific List View, you could specify styles(not the only way, but probably the easiest one) in xsl template as demonstrated below:

      • Thank you Vadim!

        Hopefully only one more question…

        I’m testing the accordion by typing in:

        I’m a vExpert… What about me?

        and it’s showing in the Accordion header as:

        I'm a vExpert… What about me?

        I realise this is html code for the ‘ symbol but any solution to how to remove it so it displays normally?

        Thanks so much.


  3. Hi, this is great as it is exactly what I am looking for.
    I do not have visual studio, is there an alternative?
    As a newbie, I could do with a bit more details on: ‘Go there to type this code…’

  4. Pingback: XSL(XSLT) Based Views(XSL File Reference in WebPart) in SharePoint 2013 | Pankaj Salunkhe SharePoint Knowledge

  5. I follow your step to create Accordion for SP2013. It works on publishing page but not in wiki page. Is there any i can resolve for wiki page?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.