Search code examples
tridiontridion-2011

Getting the tcmid of the selected item on custom button click


I have a custom button in the ribbon.

When i select any item (Component or Page) in tridion and click the custom button, i should be able to get the tcmid of the selected item.


Solution

  • var selectedID = selection.getItem(0);
    

    in the _execute method, from my tutorial at http://www.curlette.com/?p=279

    Extensions.WhoDidIt.prototype._execute = function WhoDidIt$_execute(selection, pipeline) {
    

    Please spend some time (around 1 week) looking at existing examples and solutions, including my GUI Extension tutorials. Please do make a strong effort and try for yourself before quickly posting here - you will learn more and have a greater understanding.

    GUI Extension Samples: