Difference between revisions of "Display Girder status and variables on Girder webserver"

From ETCwiki
Jump to navigationJump to search
(No difference)

Revision as of 19:42, 10 June 2013

This is a brief guide to showing status information using variables in Girder, to display them on the Girder webserver. You will be able to link status information to your Girder macro's, and have the Girder webserver display these variables as text on the main page.

Creating Girder variable

  1. Create a new girder macro, or use existing one that you want to link status information to.
    Set Girder Variable
  2. Add an action to the macro, a scripting action. Open to edit it.
  3. Open scripting window (the action you added) and enter this info
    1. macrostatus = "status1"
    2. This creates a variable in Girder named macrostatus, and sets it equal to status1
  4. You can add this scripting action to any macro you want, change the data, create other variables etc. When you execute the macro, the variable is set and it can be displayed on the webpage.


Displaying variables on Girder webserver

  1. Make sure your webserver is enabled. Go to your Girder folder, and open the httpd folder.
    Display Girder Variable in website
  2. edit the file events.html (just for our example)
  3. scroll to the H2 html tag, enter this info just below the h2 tags
    1. <% local a = macrostatus; webserver:print(a) %>
    2. This displays the variable macrostatus, which is status1
    3. For the next variable you display, use the variable b, and then c, d, e.... like this
      1. <% local b = macrostatus2; webserver:print(b) %>