This project is read-only.

Link to item with edit menu

Sep 15, 2013 at 4:19 PM
Hello Ventigrate,

We installed your solution with great satisfaction. Thanks.

We want to create a column with the Link to item with edit menu.
We tried several scenarios like below but we cannot seem to get it rendered well.
Can somebody help on this?

<FieldRef Name="Title" />
<FieldRef Name="LinkTitleNoMenu" />
<FieldRef Name="_EditMenuTableStart2" />
<FieldRef Name="_EditMenuTableEnd" />
        <GetVar Name="FreeForm" />
    <Case Value="TRUE">
        <Field Name="LinkTitleNoMenu" />
                <GetVar Name="MasterVersion" />
            <Case Value="4">
                <HTML><![CDATA[<div class="ms-vb itx" onmouseover="OnItem(this)" CTXName="ctx]]></HTML>
                <Field Name="_EditMenuTableStart2" />
                <Field Name="LinkTitleNoMenu" />
                <HTML><![CDATA[<div class="s4-ctx" onmouseover="OnChildItem(this.parentNode); return false;">]]></HTML>
                <HTML><![CDATA[<a onfocus="OnChildItem(this.parentNode.parentNode); return false;" onclick="PopMenuFromChevron(event); return false;" href="javascript:;" title="Open Menu"></a>]]></HTML>
                <HTML><![CDATA[<table height="100%" cellspacing="0" class="ms-unselectedtitle itx" onmouseover="OnItem(this)" CTXName="ctx]]></HTML>
                <Field Name="_EditMenuTableStart2" />
                <HTML><![CDATA["><tr><td width="100%" class="ms-vb">]]></HTML>
                <SetVar Name="ShowAccessibleIcon" Value="1" />
                <Field Name="LinkTitleNoMenu" />
                <SetVar Name="ShowAccessibleIcon" Value="0" />
                <HTML><![CDATA[</td><td><img src="/_layouts/images/blank.gif" width="13" style="visibility:hidden" alt=""/></td></tr></table>]]></HTML>

Kind regards,
Nov 7, 2014 at 10:08 AM
Which SharePoint edition are you using?
Nov 7, 2014 at 10:13 AM
Hello VanDest,

Nice of you to reply. Thanks.
At present we use sharepoint foundation 2010.

Kind regards,
Nov 7, 2014 at 3:54 PM

I haven't succeeded in this myself with SharePoint 2010. I think this would require additional attributes "ListItemMenu" and "LinkToItem" on the Field schema.

So either create a custom field for this or run the following PowerShell ;) It can be on an out of the box field.
asnp Microsoft.SharePoint.PowerShell -ea 0 | Out-Null

$w = Get-SPWeb http://intranet/sites/x
$l = $w.Lists["Shared Documents"]
$f = $l.Fields["MyField"]

$mi = [Microsoft.SharePoint.SPField].GetMethod("SetFieldAttributeValue", [System.Reflection.BindingFlags]"NonPublic, Instance")
$mi.Invoke($f, @("ListItemMenu", "TRUE"))
$mi.Invoke($f, @("LinkToItem", "TRUE"))

# See if added
Marked as answer by vandest on 3/16/2015 at 5:13 AM