I built a GUI extension to βenterβ my own JavaScript in the SDL Tridion 2011 publishing dialog box (as explained in this post and comments: http://albertromkes.wordpress.com/2012/01/30/tridion-gui-extensions- how-to-load-a-javascript-without-showing-a-gui-element / )
I see in the SDL Tridion publish dialog box (publish.js) that the publish dialog accepts some parameters (not the URL), they are passed. For instance:
var p = this.properties; if (p.params && p.params.items && p.params.items.length > 0)
So, in my JavaScript, I would like to get properties.params.items, but it seems like I canβt figure it out.
My JavaScript code is pasted after downloading the publication:
<cfg:extension target="Tridion.Web.UI.Editors.CME.Views.Popups.Publish"> <cfg:insertafter>Extensions.Resources</cfg:insertafter> </cfg:extension>
And in my JavaScript (and Firebug Console) I tried to get the value using $display.getView().properties , but this returns a null object.
I used Firebug to view window , $display and various other objects, but I see no way to get to the params object.
My JavaScript looks like this:
$evt.addEventHandler($display, "start", itemsForPublish); function itemsForPublish() { var p = $display.getView().properties; var items = p.params.items || []; alert(items); }
source share