Dynamic Webserver (variable processing)
Posted: Wed May 20, 2009 4:06 am
This is a slight variation on the current Webserver plug-in that will look for {{eg.globals.<variable>}} and replace it with the value of that variable.
I've been using the Web Server with these tweaks for quite a while now. It allows you to use variables from eventghost as part of the webpage output with very little overhead. This is great for people building dashboards, web consoles, status pages, etc. To use it just put it in your eventghost (and disable the other webserver plug-in if you're using it currently). Edit your HTML to use {{eg.globals.<variable}} wherever you want the info displayed, and make sure that variable is getting set in eventghost.
For example I use {{eg.globals.VMCMediaName}} to show what's currently going on with my media center (along with my VMC Controller plug-in of course).
Notes:
- Nothing other than the eg.globals variables will display.
- Variables that don't process or convert easily to a string show up as "" (null).
- This can be dangerous if combined with external form input and weak input checking. You've been warned.
~K
I've been using the Web Server with these tweaks for quite a while now. It allows you to use variables from eventghost as part of the webpage output with very little overhead. This is great for people building dashboards, web consoles, status pages, etc. To use it just put it in your eventghost (and disable the other webserver plug-in if you're using it currently). Edit your HTML to use {{eg.globals.<variable}} wherever you want the info displayed, and make sure that variable is getting set in eventghost.
For example I use {{eg.globals.VMCMediaName}} to show what's currently going on with my media center (along with my VMC Controller plug-in of course).
Notes:
- Nothing other than the eg.globals variables will display.
- Variables that don't process or convert easily to a string show up as "" (null).
- This can be dangerous if combined with external form input and weak input checking. You've been warned.
~K
