Adding Custom Actions to SharePoint using CSOM

So I’ve been working with Office 365, and deploying site collections and their contents can be … fun. I’ve found that the best approach seems to be to use the Client-side Object Model (CSOM) – the C# API – to deploy and configure my content.

On thing I didn’t think would be easy was adding Custom Actions – but this turned out to be pretty easy, to be honest. Continue reading “Adding Custom Actions to SharePoint using CSOM”

Advertisement
Adding Custom Actions to SharePoint using CSOM

Hiding a Tab Group from a custom list type in SharePoint 2010's Ribbon

I have a custom list definition that I’ve been writing. The ribbon on it looks something like this:

Unfortunately, I don’t want some of the groups shown on this tab. For example, I don’t want any of the ‘Connect & Export’ group, or ‘Customize List’ – these things could actually break my solution. So, how to hide?

Initially, I looked at the HideCustomAction Feature element. This what you’d use for hiding links to settings pages, etc., and it seems a natural choice. Unfortunately, it doesn’t allow a RegistrationId in the same way that a CustomAction element does – so there was no way to restrict this to my list only. Damn.

Continue reading “Hiding a Tab Group from a custom list type in SharePoint 2010's Ribbon”

Hiding a Tab Group from a custom list type in SharePoint 2010's Ribbon

HideCustomAction doesn't work with the EditControlBlock

So, this is a new fact about SharePoint for me – HideCustomAction Feature element doesn’t work with the EditControlBlock. Normally, you add links to menus, toolbars, etc., using a CustomAction, and hide them using ‘HideCustomAction’. Works a treat in most of the interface.

However, with the Edit Control Block (ECB) Hide custom action doesn’t work. It looks like ‘cos the menu is rendered by JavaScript, you can’t hide them. Liam Cleary posted a good article about it for SharePoint 2007, and I suspect this will be the same in 2010. It means you’re likely to have to use JavaScript to remove things off the menu :/

Don’t know how I managed to avoid this problem for 4 years!

HideCustomAction doesn't work with the EditControlBlock

New Ribbon Tab Groups and their Templates

I had a curious problem today. I was registering Custom Actions to create a TabGroup with a single Button control on SharePoint’s ribbon:

I did this following Chris O’Brien’s post about “Adding ribbon items to existing tabs/groups“. It worked well, except that as we’re not registering the custom action against a particular list type (e.g. “101”), this button will appear on any list using the tab specified in the CommandUIDefinition‘s Location. Continue reading “New Ribbon Tab Groups and their Templates”

New Ribbon Tab Groups and their Templates