Skip and go to main content

CX & Design December 23, 2014

SDL Tridion Bookmarklet Challenge Entry – Rename Tridion Item


Way back in August, one of the SDL Tridion MVPs – Dominic Cronin, proposed a challenge to the SDL Tridion community. The challenge was to create a bookmarklet to perform something useful in the SDL Tridion GUI.

A bookmarklet is a small piece of JavaScript code which executes as a bookmark within the browser to give you a bit of functionality that wasn’t already there. There are many general ones around on the internet that can do all sorts of things.

The challenging part of this challenge was definitely thinking of something to do in SDL Tridion. Bookmarklets are not GUI Extensions, they need to be really, really simple. The idea is to save you a few clicks or perform some repetivie actions – like a macro in a text editor.

I tried a couple of ideas and then hit on renaming items! Quite often I spot a Component Template not following naming conventions and want to quickly rename it but you have to open the item and then save it. It’s like 3 steps – I reckoned I could make that easier.

So my entry is Rename Tridion Item

Disclaimer: this code is not production quality and has only been briefly tested on a dev environment – I suggest that you do the same as it may automatically check in items depending on your permissions. I am not responsbile for any data loss! Only tested on SDL Tridion 2013 SP1.


  • Focus an item in the dashboard view and click the link.
  • A prompt will appear like this (old school!)
  • Enter the new name and click OK and the item is renamed


To install:

  1. Create a new bookmark in your browser called “Rename Tridion Item
  2. Add the following to the link field:
    javascript:(function(e,t,n,r,i,s){try{while(i=e.frames[n++]){if((r=i.$display&&i.$display.getView())&&r.getId()==t){s=r;break}}var o=s.getMainInterface().getFilteredListControl().getList().getFocusedItem();var u=i.$models.getItem(o);if(u!==undefined){u.load();var a=prompt("Enter a new name for "+u.getTitle());if(a!=null&&a!==undefined){u.setTitle(a,true);;u.setChanged()}}else{alert("No item selected")}}catch(f){}})(,"DashboardView",0)
  3. Save

I’ve minifed the code here – so you can’t actually see what it does, full source below. This raises a good point about the security of bookmarklets – you’re running someone elses code in the browser. Some bookmarklets even load external JavaScript files so you should always be very careful with them.

Here’s the full code:

// SDL Tridion Bookmarklet for Renaming items
// This code is provided as-is with no warranty expressed or implied
// Author: Robert Stevenson-Leggett, 23/12/2014
// Based on UI Beardcore code from:
(function (UI, B, e, a, r, d)
while (r = UI.frames[e++])
if ((a = r.$display && r.$display.getView()) && a.getId() == B)
d = a;

var itemId = d.getMainInterface().getFilteredListControl().getList().getFocusedItem();

var item = r.$models.getItem(itemId);
if(item !== undefined)
var name = prompt('Enter a new name for ' + item.getTitle());
if(name != null && name !== undefined)
alert('No item selected');
catch (x) {
//Assume we're not on an SDL Tridion instance

})(, 'DashboardView', 0)

I followed the process in this article:–net-18154

I found it quite difficult to develop as I haven’t done any GUI Extensions for a while so remembering how it all worked was challenging but a lot of fun.

Questions? We are here to help!


If you're reading this, you unfortunately can't see the form that's supposed to be here. You probably have an ad blocker installed. Please switch off your adblocker in order to see this form.

Still encountering problems? Open this page in a different browser or get in touch with us: [email protected]