0

I am trying to add a field that hold a hypelink (custom per each list entry) onto a custom display form. SP Designer generates the following code:

<tr>
    <td width="190px" valign="top" class="ms-formlabel">
        <H3 class="ms-standardheader">
            <nobr>Contract workspace link</nobr>
        </H3>
    </td>
    <td width="400px" valign="top" class="ms-formbody">
        <a href="https://share.xxxx.com/sites/ABCDEFG/_layouts/15/start.aspx#/Contract%20Workspace/Forms/AllItems.aspx?RootFolder=%2Fsites%2ABCDEFG%2FContract%20Workspace%2Fumowa sprzedazy g%C5%82owica USG">
            <xsl:value-of select="substring-after(@Contract_x0020_workspace_x0020_l, ', ')"/>
        </a>
    </td>               
</tr>

This however does not work. I can see that the html here is static and will not change on individual row level. The hyperlink itself is kept in the "Contract Workspace Link" field (which is displayed just fine on the All Item view on list level).

Can anybody help with making this link work on custom display form?

1

what's the link need to hold ,

  • you can use list Item ID or title or what else field using @Field.

  • For variable as $variablename

For example

if you need to pass the ID of the list item to your link you can use it as

<td class="ms-vb">
   <a href="http://rootsite/Lists/Product/EditForm.aspx?ID={@ID}">
      <xsl:value-of select="@Product_x0020_Name"/>
   </a>
</td>

For more details check Add-a-hyperlink-to-a-Data-View

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.