Ive done some dev work with sharepoint last year but nothing like what im building today so Im not very experienced with it. I am trying to add a custom button to the ribbon in a list modeled on the contacts template. I wrote the code for the button and tested it in a custom list. For some reason it isnt showing up in the Contacts list i need it to. everything works just fine in a custom list. Heres my code;
<CustomAction
Id="CsvExportButton"
RegistrationId="100"
RegistrationType="List"
Location="CommandUI.Ribbon"
Sequence="20"
Title="Export to CSV">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListItem.New.Controls._children">
<Button
Id="SS7.Ribbon.Customizations.Tab.Actions.Controls.ExportCSV"
Alt="Export selected items to CSV"
Sequence="20"
Command="CMDAlertRibbonButton"
LabelText="Export to CSV"
Image16by16="/_layouts/1033/images/formatmap16x16.png"
Image32by32="/_layouts/1033/images/formatmap32x32.png"
TemplateAlias="o1"/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command="CMDAlertRibbonButton"
CommandAction="javascript:
function resultCallback(result, value)
{
SP.UI.Notify.addNotification('Success!');
SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK);
}
var ctx = SP.ClientContext.get_current();
var items = SP.ListOperation.Selection.getSelectedItems(ctx);
var myItems = '';
var i;
for (i in items)
{
myItems += '|' + items[i].id;
}
if(myItems != '')
{
var options = {
url: '{SiteUrl}/_layouts/MyPage.aspx?Items=' + myItems + '&ListId={SelectedListId}&Source={Source}',
title: 'My Page',
allowMaximize: false,
showClose: true,
width: 600,
height: 600,
dialogReturnValueCallback: resultCallback };
SP.UI.ModalDialog.showModalDialog(options);
}" />
</CommandUIHandlers>
</CommandUIExtension>