turbine-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C Mason@ Intechtual" <cma...@intechtual.com>
Subject RE: Trim() or Truncate() functions in templates
Date Fri, 19 Oct 2001 20:56:24 GMT
It is possible to do something like this:

	$body.substring(0, 10)

providing that $body is referring to a String. Although it would probably
be better to keep that logic with the code that is building your context.


Chris Mason

-----Original Message-----
From: Lang, Cliff [mailto:clang@proxicom.com]
Sent: Friday, October 19, 2001 2:57 PM
To: turbine-user@jakarta.apache.org
Subject: Trim() or Truncate() functions in templates


Are there any Trim(), or Truncate() functions accessible from your
templates?  Can you access custom code or java functions directly from a
template?

What I have is an array of users with each user containing a variable
text field being returned with all the rows being displayed in a table.
Like the userlist table used in Flux.

What I want to do is trim the text to say 10 chars, so my table will
format nicely, then I will take the real data and make in available via
an <img alt link>

In a macro it would be something like:

#macro (entryCell $body $width)
  <td bgcolor="$ui.formFieldColor" width="$width">
    <font face="$ui.sansSerifFonts">
      trim($body, $width) <img src="/1x.img" href="#" alt="$body">
&nbsp;
    </font>
  </td>
#end




Any ideas?  Is this more a velocity question?


Thanks,  Cliff

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Mime
View raw message