[Tb] math on HTML Export?

From: Richard Chamberlain <richard>
Date: Fri May 20 2005 - 15:27:54 EDT

Hello Scott,

On 20 May 2005, at 04:53, Scott Price wrote:

> Hello--
>
> I'm playing around with HTML export templates, and I'd like to do
> some math on retrieved attributes. For instance:
>
> <p>This is my attribute: ^get(userAttribute)^</p>
> </p>This is my attribute x 2: ^get(userAttribute + userAttribute)^</p>
> <p>This is my attribute x 2: (^get(userAttribute) * 2) </p>
>
> Obviously, none of those work. I only get one round of parsing.
> I'm not sure whether there's a Rule code that does this, either,
> since I'm not summing all the values of childrens' userAttributes,
> I'm summing a single value and itself.
>
> Thoughts, anyone?

How about using JavaScript?

<p>This is my attribute: ^get(userAttribute)^</p>
<p>
     <script type="text/javascript">
         document.write("This is my attribute + attribute: " + (^get
(userAttribute)^ + ^get(userAttribute)^));
     </script>
</p>
<p>
     <script type="text/javascript">
         document.write("This is my attribute x 2: " + (^get
(userAttribute)^ * ^get(userAttribute)^));
     </script>
</p>

I've not tested it but it should work. This way you can perform any
kind of arbitrary math that JavaScript can perform.

Richard
Received on Fri May 20 13:29:04 2005

This archive was generated by hypermail 2.1.8 : Wed Dec 14 2005 - 10:45:38 EST