Using RSS and XML Web Part
I really like the XML Web Part because of its simplicity - take an XML data source, apply XSLT and have it pretty much whatever you want.
I was recently asked to create a jump-to-list-item dropdown box so that you could place the web part on any page and a user could select an item from that list from a dropdown and it would take them to the list item. Here are the steps that it took to create this using the out of the box XML Web Part.
...sounds like a project for the future...
I was recently asked to create a jump-to-list-item dropdown box so that you could place the web part on any page and a user could select an item from that list from a dropdown and it would take them to the list item. Here are the steps that it took to create this using the out of the box XML Web Part.
- Turn on anonymous access on your list (here's how to do it)
- RSS Enable your list and then view the RSS Feed (you can do this through the list's Action menu)
- Place an XML Web Part on your page
- Modify the settings of the XML web part by pasting your RSS Feed URL into the webpart's XML Source attribute.
- Open the XSLT editor and place the following code:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<select id="jumpDD">
<option>
Select
</option>
<xsl:for-each select="rss/channel/item">
<option>
<xsl:attribute name="value">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</option>
</xsl:if>
</xsl:for-each>
</select>
<input class='webPartJump' onclick="window.location.href=jumpDD.options[jumpDD.selectedIndex].value;" onfocus="this.blur()" type="button" value="Go" />
</xsl:template>
</xsl:stylesheet> - *Optional: I did this for a Wiki Page Library so I wanted the wiki page to open directly instead of opening the item (which contained the page). In the RSS Settings for the list you can specify to open the document directly instead of going to the item.
...sounds like a project for the future...
Comments