User manual

© 2011 Racktivity NV 108/160
Antwerpsesteenweg 19 - 9080 Lochristi - Belgium - www.racktivity.com v 2014.5.14
JavaScript Macros
JavaScript Macros, on the other hand, have to do with editing the page. These macros can
have a wide range of usage, from highlighting code and showing a Google map, to adding
a Wizard. The macro files themselves (JavaScript files) are stored in
/opt/qbase5/www/lfw/js/macros and must have unique names.
In this section you can find an overview of the available macros and how you can create
your own macro.
Using Macros in Documentation
When you create a page, you can add macros to for example to add a graphic or
information block.
To include a macro on a page, you have to apply this structure:
[[name_of_macro]][[/name_of_macro]]
Each macro has its own properties: some macros need data, some need configuration, and
some macros work without any additional information.
Macro Configuration
Configuration parameters of a macro are added in the opening tag of the macro:
[[name_of_macro: param1=foo, param2=480]][[/name_of_macro]]
Macro Data
If a macro needs data, for example to build a graph, then this must be provided in the body
of the macro, for example see the RGraph Macro.
If the macro doesn't have a body, then you can use the short notation of the macro, similar
to the short notation of an html tag:
[[name_of_macro/]]
or
[[name_of_macro: param1=foo, param2=480 /]]
REST Calls
A parameter of a macro can also be a REST call to a PyApps' application server service.
This allows you to execute a service inside your macro.