سؤال

I am trying to use a SOAP data connection to pull data from a link list (3 lists) on one site collection and 2 subsite onto a page on a same site collection. My SOAP connection is configured correctly and is working fine.

However, I am trying to configure the Data View Web Part so that it does the following: The first column should display the "Title" field of the link, but format as a hyperlink to the URL for that particular link.

i want to bind the title with url so when the user click the Item title, it will navigate to item detail (DispForm) based with Item id selected.

@ows_FileRef will returned value as the following:

1;#sites/Test/Lists/Invitation/1_.000

<td class="ms-vb">
      <xsl:variable name="DocURLtemp" select="substring-after(@ows_FileRef, '#')"></xsl:variable>
      <a href="/($DocURLtemp)/Dispform.aspx?ID={@ows_ID}"><xsl:value-of select="@ows_LinkTitle" /></a>

</td>

so the above will return the following url(containg version no e.q 1_.000): http://project.testcontoso.com/sites/Test/Lists/Invitation/1_.000/Dispform.aspx?ID=1

as you can see the final url is not valid url.

what i want to achieve is

http://project.testcontoso.com/sites/Test/Lists/Invitation/Dispform.aspx?ID=1

Please anybody can help me. thank you

هل كانت مفيدة؟

المحلول 2

I finally resolved using the following:

<td class="ms-vb">
    <xsl:variable name="DocURLtemp" select="substring-after(@ows_FileRef, '#')"></xsl:variable>
    <xsl:variable name="Doc" select="substring-before($DocURLtemp, 'Invitation/')"></xsl:variable>
    <a href="/{$Doc}Invitation/Dispform.aspx?ID={@ows_ID}"><xsl:value-of select="@ows_LinkTitle" /></a>
</td>

نصائح أخرى

You can try below

<td class="ms-vb">
    <xsl:variable name="PropertiesURL">
        <xsl:value-of select="@EncodedAbsUrl"/>
        <xsl:value-of select="@Path" />
        <xsl:value-of select="'/Forms/DispForm.aspx?ID='"/>
        <xsl:value-of select="@ows_ID"/>
    </xsl:variable>
    <a href="{$PropertiesURL}" target="_blank"><xsl:value-of select="@ows_LinkTitle" /></a>
</td>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top