As far as I know, you need to specify all views or use a wildcard. It will be nice that the isAvailable function will work for the Ribbon Toolbar buttons, right? This means that if the command returns false in the _isAvailable method, the button will not be displayed ...
Ok, I found a job. You can do something like this in your isAvailable method in your command:
Your.Namespace.PT_ItemCommenting.prototype._isAvailable = function PT_ItemCommenting$_isAvailable(selection) { var isAvailable = $display.getView().getId()!='DashboardView'; if(isAvailable){ return true; } var button = $controls.getControl($("#ItemCommenting"), "Tridion.Controls.Button"); button.hide(); return false; };
I think this is actually a good practice, as it will βhideβ teams if they are not available, right?
Let me know how it works.
Jaime Santos AlcΓ³n
source share