Difference between revisions of "Display Girder status and variables on Girder webserver"
From ETCwiki
Jump to navigationJump to searchLine 18: | Line 18: | ||
## For the next variable you display, use the variable b, and then c, d, e.... like this | ## For the next variable you display, use the variable b, and then c, d, e.... like this | ||
### <% local b = macrostatus2; webserver:print(b) %> | ### <% local b = macrostatus2; webserver:print(b) %> | ||
+ | [[Category:Girder]] |
Latest revision as of 15:17, 25 July 2015
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
- Create a new girder macro, or use existing one that you want to link status information to.
- Add an action to the macro, a scripting action. Open to edit it.
- Open scripting window (the action you added) and enter this info
- macrostatus = "status1"
- This creates a variable in Girder named macrostatus, and sets it equal to status1
- 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
- Make sure your webserver is enabled. Go to your Girder folder, and open the httpd folder.
- edit the file events.html (just for our example)
- scroll to the H2 html tag, enter this info just below the h2 tags
- <% local a = macrostatus; webserver:print(a) %>
- This displays the variable macrostatus, which is status1
- For the next variable you display, use the variable b, and then c, d, e.... like this
- <% local b = macrostatus2; webserver:print(b) %>