Global scripts

Go to top  Open direct link

In cases where particular scripts should be carried out for all channels you can enter these directly into the management console. Scripts that should only be carried out on specific channels can be configured in the Management Console too. Global scripts, unlike scripts per channel, are easier to maintain and are better for performance. If both a global and an individual script are defined for a channel, then the global script is overwritten by the channel script.

 

info Please note

Making changes through these consoles might render your system inoperable, pose security risks for your data and users, and result in loss of compliance with data protection regulations as well as Picturepark terms and conditions. Access is dependent on your permissions, license and certification status. If you are unsure of whether you should make changes here please contact support.

 

globalscript_en

 

Example scripts

folder_open_blMake message required for shares and orders

controller.mailingMessageRequired = true;

 

folder_open_blAdd text to previews depending on the assigned rights template

In the below example a text is added to the preview, if the asset is assigned a defined rights template. The background is also made red, should the template have been manually modifed. The code can be expanded, by copying, inserting and adjusting the corresponding code.

 

var style = "<style> .ux-explorerview-custom-medium, .ux-explorerview-custom-small, .ux-explorerview-custom-large {width:100%!important;} </style>";

var divEnd = "</span></div>";

 

PP.common.Tpl.setCustomRenderer(function(values, thumbSize) {

   var custBgColor = "";

 

   if(values.IsAssetRightTemplateOverridden == "1")  {

       custBgColor = "background:rgba(204,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#6Fcc0000,endColorstr=#6Fcc0000);";

       custBorderColor = "aa1919";

       custFontColor = "ffffff";

   }

   else {

       custBgColor = "background:rgba(227,227,227,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#6Fe3e3e3,endColorstr=#6Fe3e3e3);";

       custBorderColor = "999999";

       custFontColor = "000000";

   }

 

   var divStart = "<div style='position:absolute;width:100%;height:15px;border-bottom:1px solid #" + custBorderColor + ";text-align:right;padding-top:1px;font-weight:bold;" + custBgColor + "color:#" + custFontColor + ";'><span style='padding-right:10px'>";

 

  if(values.AppliedAssetRightTemplateId == "Archived") {

       return style + divStart + 'Archived' + divEnd;

   }

    else {

       return '';

   }

});

folder_open_blAdding an icon to the preview depending on the assigned rights template

PP.common.Tpl.setCustomRenderer(function(values, thumbSize) {

   if(values.AppliedAssetRightTemplateId == "Archived")

      return style + '<div style="position:absolute;width:100%;background:#e9e9e9;opacity:0.6;height:21px;border-bottom:1px solid #d9d9d9;"></div><img style="width:16px;height:16px;position:absolute;top:3px;right:7px;" src="URL TO ICON">';

  else

      return '';

});

 

folder_open_blChanging the text if a container is empty or there are no search results

This script overwrites the text that is shown per default in the asset browser, if a container is empty (NoResults) or a search has no results (NoSearchResults). The text can be overwritten for every configured UI language. In the below example, the text for German (1), English (2) and French (3) is overwritten.

 

switch(controller.getConfiguration().getUserLanguageId()) {

 case 1:

         Locale.AssetBrowserStore.NoResults = "No Results de";

         Locale.AssetBrowserStore.NoSearchResults =  "No Search Results de";

         break;

 case 2:

         Locale.AssetBrowserStore.NoResults = "No Results en";

         Locale.AssetBrowserStore.NoSearchResults =  "No Search Results en";

         break;

 case 3:

         Locale.AssetBrowserStore.NoResults = "No Results fr";

         Locale.AssetBrowserStore.NoSearchResults =  "No Search Results fr";

         break;

}