Over the past week or so I have started to build a web part that I have been meaning to build for a while. This web part will do the following:
- Connect to a site collection
- Connect to a site
- Connect to a list or library
- Connect to a specific view within the list or library
- Apply a custom XSL to the returned results
- Apply a custom CSS to the returned results
- Render a nice looking aggregation web part
This has been a personal project of mine for a while now, it originally started as a CQWP replacement which another version I am working on will become. This version is more about aggregating specific content from views. The reason for this is that over the past year or longer I have noticed that business users are after a simple approach of aggregating content into a page. They like the CQWP but also like "hand-crafting" views on lists and libraries to get the desired results that they need. This web part aims to assist with this not only be allowing users to select the views that they spent ages building but also allow for develops to style the outputted XML by using custom XSL and CSS. So let me show you what it looks like:
Once the web part is added to the page you will need to configure it via the tool pane as you would normally with any web part.
When the tool pane opens the first configuration section simply is the about bit but also allows you to set the title that you want to appear on the web part once it is rendered on the page.
Now we have our title set we need to set the data connections, i.e. the site collection etc that we wish to connect to.
This list is populated once you add the web part to the page. Just ignore the empty dropdown lists not very user friendly but it is just the debug version J
Once you have selected the site collection the list of sites is presented:
Once you have selected the site or sub site the list of lists and libraries is then populated.
At the moment it also shows any system lists and libraries, obviously this would be changed if it was finished. Now we need to select the lists and the view list will be populated:
For this I am using a new view I created called "NewsItems". Now we have our data connection and have enabled the "Show Data" option we only need to set the XSL and CSS styles that we will use.
The list of XSL styles and CSS can come from a specific library or use the "XSL Style Sheets" location in the "Style Library" of the site collection. The lists are populated by reading the lists and loading the XSL filename or CSS filenames:
Once we apply the following settings we are then presented with the following web part with the relevant data.
It is only in early development and needs improvements in the user interface and also the whole security thing needs sorting out, so nothing too much!! J
Anyway just wanted to get peoples reaction if you like it or you think it is really rubbish let me know. All feedback welcome!!