This topic has been in my queue for quite some time, and I felt it was long overdue for me to write something up about it.
Dan had asked about the business need for resolving media library item aliases. This question got me thinking: perhaps one might not want to resolve media library aliases.
So what can be done to prevent media library items from being linked in Sitecore alias items? Well, you could remove the ‘Insert Media Link’ button from the General Link field type.
Removing buttons from existing field types in Sitecore is extremely easy, and no code changes are required. All you have to do is delete “Menu” items under field types in the Core database — although I would recommend that you duplicate an existing field type which results in a new field type, and then delete “Menu” items under the duplicate item just as I’ve done here on the General Link field type:
You might be asking why I deleted the WebEdit Buttons folder which drives the insert link functionality for the Page Editor. Removing buttons from the Page Editor isn’t as straightforward as deleting items in Sitecore, and I might cover this in a future blog post.
I then used my new field type:
As you can see buttons were removed:
If you have any examples of where you had to remove buttons from field types in Sitecore, please drop a comment.
In a future post, I will cover adding new buttons to field types — unlike this post, such a change requires adding code.
Until next time, have a Sitecoretastic day, and Happy New Year!