0

SP2007 Using a Links List, I want to:

  1. Convert to DVWP
  2. Change layout to dropdown
  3. Enable list items to direct/redirect user to url of the selected list item

Numbers 1 and 2 are cake. Been there, done that.

Number 3 however is not. When converting the DVWP to a dropdown layout, the links (urls) lose the url. They no longer work. Nothing redirects the user.

So now I have this:

<xsl:template name="dvt_1">
<xsl:variable name="dvt_StyleName">Drpdwn</xsl:variable>
<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
<select name="ID" size="1">
<option selected="true" value="0">Choose One...</option>
<xsl:call-template name="dvt_1.body">
    <xsl:with-param name="Rows" select="$Rows" />
</xsl:call-template>
</select>
</xsl:template>
<xsl:template name="dvt_1.body">
        <xsl:param name="Rows" />
        <xsl:for-each select="$Rows">
                <xsl:call-template name="dvt_1.rowview" />
        </xsl:for-each>
</xsl:template>
<xsl:template name="dvt_1.rowview">
    <option>
    <a href="{substring-before(@URL, ', ')}">
         <xsl:value-of select="substring-after(@URL, ', ')" />
   </a>
    </option>
</xsl:template>

I have tried several things but nothing seems to work. And since I don't know much about code, I could have been real close to getting it done, just wasn't sure what to look for or change.

Can someone help?

2 Answers 2

1

You need to bind an event to the selection of the item to navigate to the url.

Matt (@ionline247) has an example here, http://mattbramer.blogspot.com/2010/10/sharepoint-integrate-aspnet-controls_28.html

2
  • Yeah. Don't know how to do that. I need to populate the ddl with user friendly text, but have SP use the actual URL to do the redirect. I don't know how to make that happen. Commented Jan 15, 2014 at 20:23
  • The above series of articles explains that. Commented Jan 15, 2014 at 20:43
0

Mike - If the number of list items you are linking to is small (i.e. around 10) and will remain fairly static, this post may help you out: https://jennyssharepointtips.wordpress.com/2014/07/06/use-the-html-form-web-part-to-create-a-drop-down-of-links/

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.