在文档库加一个Feature,应用于文件而不应用于文件夹
Feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="7702C5CC-434F-4bd2-9D7C-F3F09106210B"
Title="Document center menus"
Description="This create menus for Send to History doc and Batch check in."
Version="1.0.0.0"
Scope="Site"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="DocMenus.xml" />
</ElementManifests>
</Feature>
DocMenus.xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="ECBItemSendToHistory"
RegistrationType="ContentType"
RegistrationId="0x0101"
GroupId="ECBItem"
Location="EditControlBlock"
Sequence="106"
Title="Send To History"
Rights="ManageLists">
<UrlAction Url="/"/>
</CustomAction>
</Elements>
关键的地方在于RegistrationType是ContentType, 而RegistrationId是0x0101,这个ID表示文档库里文件的内容类型
其它的,如文件夹的内容类型是0x0120
Feature.xml
<?xml version="1.0" encoding="utf-8" ?>
<Feature Id="7702C5CC-434F-4bd2-9D7C-F3F09106210B"
Title="Document center menus"
Description="This create menus for Send to History doc and Batch check in."
Version="1.0.0.0"
Scope="Site"
xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="DocMenus.xml" />
</ElementManifests>
</Feature>
DocMenus.xml
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="ECBItemSendToHistory"
RegistrationType="ContentType"
RegistrationId="0x0101"
GroupId="ECBItem"
Location="EditControlBlock"
Sequence="106"
Title="Send To History"
Rights="ManageLists">
<UrlAction Url="/"/>
</CustomAction>
</Elements>
关键的地方在于RegistrationType是ContentType, 而RegistrationId是0x0101,这个ID表示文档库里文件的内容类型
其它的,如文件夹的内容类型是0x0120
浙公网安备 33010602011771号