SharePoint Feature: Add Column from Existing Site Columns menu item

Question: what is the easiest way to add a column to a list or document library in SharePoint 2007?
Answer: navigate to the list, from the Settings menu, choose Create Column.

Question: how do you add an existing Site Column to a list or document library?
Answer: navigate to the list, from the Settings menu, choose List/Document Library Settings, scroll down to the Columns section and click Add from existing site columns.

In the beta versions of SharePoint 2007 there was an easier way to add an existing Site Column to a list or document library because there was another menu item in the Settings menu: Add column from existing site columns. For those of you who are nostalgic about the beta's of Office 12, and want to have the menu item back: I've created simple feature to add the menu item:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="
http://schemas.microsoft.com/sharepoint/">
    <CustomAction
        Id="{F32CD702-0391-4b55-A8D6-7653650DEF95}"
        Location="Microsoft.SharePoint.StandardMenu"
        GroupId="SettingsMenu"
        RegistrationType="List"
        Sequence="0"
        ImageUrl="_layouts/images/menuaddcolumn.gif"
        Title="Add column from existing site columns"
        Description="Add an existing site column to store additional information about each item."
        Rights="ManageLists"
        >
        <UrlAction
            Url="javascript:window.location= '{SiteUrl}/_layouts/AddFieldFromTemplate.aspx?List={ListId}&amp;Source=' + window.location"/>
    </CustomAction>
</Elements>

The feature uses the Javascript tric which I explained yesterday (this feature was actually the reason for it). If you want to download the complete feature, packaged in a nice SharePoint Solution (WSP); just click here!

Here's a screenshot of the result:

SmartFeatureAddSiteColumn.gif

aggbug.aspx?PostID=3764130

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值