User manual

© 2011 Racktivity NV 126/160
Antwerpsesteenweg 19 - 9080 Lochristi - Belgium - www.racktivity.com v 2014.5.14
Parameters
The body of the macro should be a list of space separated tags and labels as defined by the
Pylabs Tag format.
Example 1
The tasklet test1.py lists all the tags and labels in a page. As we have mentioned in
explaining how the search functions, all the pages are created with default tags that are:
space:space_name
page:page_name
Where space_name is the name of the space and page_name is the name of the page.
Sample 1 is the result of calling the Generic macro with 'debug' as one of the labels; code
is shown below:
[[generic]]debug tagkey:tagvalue label sample[[/generic]]
Example 2
The tasklet test2.py on the other hand, only prints out a default message. Sample 2 is the
result of calling the Generic macro with 'demo' as a label; code is shown below:
[[generic]]a:b demo[[/generic]]
Grid Macro
The grid macro is a macro that builds a table in which you can sort on the columns.
Parameters
The Grid macro does not accept parameters, all data is provided in the body of the macro.
The columns are specified in a list like this:
"columns": ["Rack", "Description"]
For each row there's a dictionary that contains the values for each cell from that row. Also,
for each column, there's a dictionary with options inside the "model" section. For instance,
the "Rack" column has these options:
{
"sortable": true,
"formatter": "pagelink",
"formatoptions": {
"link":"path",
"prefix":"#/Doc/"
}
}
If the "sortable" option is set to true, then the table rows can be ordered based on the
values from this column.
Also, there's a "formatter" option which specifies which type of formatting should be done
for this column.
In this case, it is set to "pagelink". This means that links are automatically constructed