User Tools

Site Tools


admin:transforming_page_values

Transforming Page Values

You may want to do something more clever than just displaying the value when creating a page - this is where being able to transform page values comes in handy.

Lets say we have a value called 'Humidity' that we want to display as a very simple bar-graph. At 100%, the graph should be 500 pixels tall.

Since humidity is only ever a value between 0 and 100%, we will need to multiply it by 5 in order to get a 0-500 measurement.

So we start with our basic substitution…

[Humidity]

And we tell the system that we want to apply a transform. This is done by adding a caret character (^) to the end of the name, followed by the transformation itself.

For example, to multiply by 5, we use this…

[Humidity^*5]

Other Examples

Likewise, if we wanted to instead fit it into a small 50-pixel tall bar graph, we would divide by 2…

[Humidity^/2]

A very specific case - if we were using a measurement called 'Direction' for rotation, but '0' degrees from the measurement pointed EAST and our image pointed NORTH at 0 degrees, we could just offset the value by 90 degrees…

[Direction^+90]

Functions Supported

Currently, only basic math functions (+, -, * and /) are supported. Others are planned for later versions as the need arises.

admin/transforming_page_values.txt · Last modified: 2015/07/31 02:12 by sharding