velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Christian <si...@stoutstick.com>
Subject Re: macro library
Date Mon, 04 Apr 2005 08:58:09 GMT
I don't know personally, but I imagine if you were to create such a 
thing, it would be better as a Tool than a set of macros:

  - it's faster, which if you start rendering lots of simple HTML tags 
like this could be relevant
  - you have a lot more flexibility in pure Java (overloading, anyone?).

- s

Uday Kumar wrote:
> Hi,
> 
> Has anyone developed a macro library for standard html items?  For
> example:
>  
> #macro (html_href $link $text)
> 
> <a href='$link'>$text</a>
> 
> #end
> 
> Regards,
> uday 
> 
> 
> -----Original Message-----
> From: Jason Chodakowski [mailto:jasonc@hyperworx.com]
> Sent: Sunday, April 03, 2005 6:22 PM
> To: velocity-user@jakarta.apache.org
> Subject: Template not rendering
> 
> 
> Any thoughts as to why this template snippet won't render? CatMap is a
> java.util.HashMap - should it be a Hashtable instead?
> 
> Thoughts?
> 
> Thanks,
> 
> J --
> 
> #foreach($Category in $CatMap.keysSet())
> #set($SKUS = $CatMap.get($Category))
> <P><B>${Category.Name}</B></P>
> <!-- Category ${Category.Name} -->
> #foreach($SKU in $SKUS)
> <a href="/foo?do=snot&id=${SKU.Id}">${SKU.Description}</a><BR>
> #end
> <!-- End Category ${Category.Name} -->
> #end
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 

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


Mime
View raw message