I'm scratching my head at this problem. I can't work out how I need to register my custom action so that in the context of a page content type it will appear in the ribbon under the "File" tab (Ribbon.Document) in an active list view web part. I'd foolishly assumed that I wouldn't have to do anything special to achieve this, which was already working in the context of an actual view for a document library. This is a sandbox solution. I registered the action in my feature like this (leaving some stuff out and renaming anything identifiable):
<CustomAction Id="MyCompany.Publications.CustomActionsGroup"
Location="CommandUI.Ribbon"
RegistrationId="{$ListId:Publications;}"
RegistrationType="List"
Sequence="10001"
Title="Actions">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.Documents.Groups._children">
<Group Id="MyCompany.Publications.CustomActionsGroup" Description="" Title="Actions" Sequence="1" Template="Ribbon.Templates.Flexible2">
<Controls Id="MyCompany.Publications.CustomActionsGroup.Controls">
<Button Id="MyCompany.Publications.CustomActionsGroup.MyButton" .../>
</Controls>
</Group>
</CommandUIDefinition>
<CommandUIDefinition
Location="Ribbon.Documents.Scaling._children">
<MaxSize
Id="PGS.Imaging.GeoNet.Scaling.Publications.CustomActionGroup.MaxSize"
Sequence="10001"
GroupId="PGS.Imaging.GeoNet.Publications.CustomActionsGroup"
Size="LargeLarge" />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler .../>
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
As I said, this does work in the context of the actual document library. It's a new group that appears under the Files tab. I naively assumed it would also appear similarly for a web part page that contains a list view web part on that same document library. It does not. I've tried registering to the Pages list and then it appears in views for the Pages document library but not on an actual page. I tried using "ContentType" for RegistrationType and "0x" for RegistrationId (I can use javascript and CSS to limit where it appears), but that still does not appear in this context. Inspecting the HTML source shows that the hidden input for the tab I want to appear under is, as in the other context, given the value "Ribbon.Document". I have no idea what I'm missing here, but perhaps it's the value for the group template that's not working. Can anyone help? Many thanks.