Script action

Smartsite 7.8 - ...

The script action can be used to open a new tab within the manager or within the browser, and open a specific url, e.g. to an application page.

The script itself and other (action) parameters should be specified within the parameters field of the action, using xml notation.

The closetab parameter indicates whether or not the tab which is opened within the manager, should be closed immediately or not, after executing the specified script.

Example 1

This example will open a new tab within the manager and show the wheather forecast for Delft.

Create the following action:

Naam Wheather forecast
Code mgr-WHEATHERFORECAST
Object Smartsite.Manager.Actions.ScriptAction
Icon Choose an icon from the list or use an icon/gif from disk.
Show on dashboard Check the box
Menu Choose a menu
Parameters
XML CopyCode image Copy Code
<parameters>
   <parameter name="closetab">false</parameter>
   <parameter name="script"><![CDATA[ 
      var newFrame = $("<iframe style=\"width: 100%; height: 99%; border: 0\" />");
      $("#tcl-center-body").append(newFrame); 
      newFrame.attr("src", "https://darksky.net/forecast/51.9995,4.3627/ca12/en"); 
    ]]></parameter>
</parameters>
User roles Select for which user roles this action should be available.

When you start this action, the result will be:

Example 2

This example will open a new tab within the browser and open the Smartsite feedback page.

Create the following action:

Naam Smartsite feedback
Code mgr-FEEDBACK
Object Smartsite.Manager.Actions.ScriptAction
Icon Choose an icon from the list or use an icon/gif from disk.
Show on dashboard Check the box
Menu Choose a menu
Parameters
XML CopyCode image Copy Code
<parameters>
   <parameter name="closetab">true</parameter>
   <parameter name="script">
      window.open('https://seneca.formulierenserver.nl/smartsite-feedback-formulier');
   </parameter>
</parameters>
User roles Select for which user roles this action should be available.