You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "White, Tim" <Ti...@qwest.com> on 2004/02/13 20:59:52 UTC

"End" of a velocity tag?

I'm trying to set up tag recognition for DreamWeaver.

To do this, I need to define the string that starts and ends each tag.

The problem is, I can't seem to find a string that ends the tag.

i.e. in jsp you have < >, and in Smarty you have {}, but for velocity,
there doesn't appear to be a closing tag for things like #foreach.

Also, since #end is shared by #if and #foreach, I can't mark them
uniquely in DreamWeaver.

This is making it much harder to get my template designers to adopt
coding the velocity themselves (as opposed to having me do it), and
that's frustrating, since that's the whole point of velocity!

Any thoughts on how I can 'end' my velocity tags?

Thanks,

Tim White

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


Re: "End" of a velocity tag?

Posted by Rodrigo Reyes <ro...@instaservi.com>.
My 2 cents...
    I have been working heavily with Velocity for almost a year, and 
when a template gets really complicated and you don't have some tool 
which helps with a WYSIWYG view, having #end for both #if and #foreach 
tags can be confusing.
    Hope you finally succeed setting up tag recognition in Dreamweaver. 
It's a great tool but it's not very friendly with Velocity Tags. Maybe 
that's one of the reasons why, when we started developing a project 
here, we used lots of Velocity code but now, we try to keep the velocity 
code as simple as possible. There aren't many good tools for managing 
complex Velocity code.
    Hope this helps...

Rodrigo

White, Tim wrote:

>I'm trying to set up tag recognition for DreamWeaver.
>
>To do this, I need to define the string that starts and ends each tag.
>
>The problem is, I can't seem to find a string that ends the tag.
>
>i.e. in jsp you have < >, and in Smarty you have {}, but for velocity,
>there doesn't appear to be a closing tag for things like #foreach.
>
>Also, since #end is shared by #if and #foreach, I can't mark them
>uniquely in DreamWeaver.
>
>This is making it much harder to get my template designers to adopt
>coding the velocity themselves (as opposed to having me do it), and
>that's frustrating, since that's the whole point of velocity!
>
>Any thoughts on how I can 'end' my velocity tags?
>
>Thanks,
>
>Tim White
>
>---------------------------------------------------------------------
>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


Re: "End" of a velocity tag?

Posted by Jonathan Revusky <re...@wanadoo.es>.
White, Tim wrote:
> I'm trying to set up tag recognition for DreamWeaver.
> 
> To do this, I need to define the string that starts and ends each tag.
> 
> The problem is, I can't seem to find a string that ends the tag.

You might look at FreeMarker. FreeMarker syntax has more clarity about 
where things start and end:

<#if x=y>
   <#list items as item>


   </#list>
</#if>

Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
FreeMarker-Velocity comparison page: http://freemarker.org/fmVsVel.html

> 
> i.e. in jsp you have < >, and in Smarty you have {}, but for velocity,
> there doesn't appear to be a closing tag for things like #foreach.
> 
> Also, since #end is shared by #if and #foreach, I can't mark them
> uniquely in DreamWeaver.
> 
> This is making it much harder to get my template designers to adopt
> coding the velocity themselves (as opposed to having me do it), and
> that's frustrating, since that's the whole point of velocity!
> 
> Any thoughts on how I can 'end' my velocity tags?
> 
> Thanks,
> 
> Tim White



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


RE: "End" of a velocity tag?

Posted by Mike Curwen <gb...@gb-im.com>.
does it work to do something like:

#foreach ($foo in $foos)
 
#end ##foreach

#if ($f00)

#end ##if


I think there was once (still is?) a problem with comments on the same
line as directives, but if this is no longer the case (or never was, my
memory might be faulty), you could use the end tags as "#end ##foreach"
and "#end ##if"
 
Unless of course, Dreamweaver doesn't like the spaces. 


> -----Original Message-----
> From: White, Tim [mailto:Tim.White@qwest.com] 
> Sent: Friday, February 13, 2004 2:00 PM
> To: velocity-user@jakarta.apache.org
> Subject: "End" of a velocity tag?
> 
> 
> I'm trying to set up tag recognition for DreamWeaver.
> 
> To do this, I need to define the string that starts and ends each tag.
> 
> The problem is, I can't seem to find a string that ends the tag.
> 
> i.e. in jsp you have < >, and in Smarty you have {}, but for 
> velocity, there doesn't appear to be a closing tag for things 
> like #foreach.
> 
> Also, since #end is shared by #if and #foreach, I can't mark 
> them uniquely in DreamWeaver.
> 
> This is making it much harder to get my template designers to 
> adopt coding the velocity themselves (as opposed to having me 
> do it), and that's frustrating, since that's the whole point 
> of velocity!
> 
> Any thoughts on how I can 'end' my velocity tags?
> 
> Thanks,
> 
> Tim White
> 
> ---------------------------------------------------------------------
> 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