Hi,
I tried this out. Inserting velocity statements was easy. I liked that
when I enter VTL statements while in source code mode it autocompletes. In
general, the extension fits well within the DreamWeaver environment, which
is great. Nice work, Jason.
One note.. The custom shield approach as described in the previous email
isn't really practical. Anytime a parenthesis or #end is nested, the shield
is incorrectly displayed. For example these break:
VTL
#set ((a == 1) || (b == 2)
DISPLAYED
[icon] || (b==2)
VTL
#foreach ($a in [1..10])
#if ($a == 10)
last item!
#end
#end
DISPLAYED
[icon]
#end
It'd be cool if we could figure out how to get this to work. This is (IMHO)
the biggest issue with Velocity & Dreamweaver. All those #!%*@ statements
(or rather all those # statements) mess up my nice WYSIWYG layout.
Solving the nested #end problem is easy, just use a separate icon for
#foreach and #end. Generally I want to see the HTML within the block, so
this is probably best anyways.
#foreach ($a in [1..10])
#if ($a == 10)
<p>Special message - last item
#else
<p>item text
#end
#end
becomes:
[icon][icon]
<p>Special message - last item
<p>item text
[icon][icon]
But the problem of nested parens is more of a bear. Assuming regexp
matching is the only way of doing this, there's probably two possible
solutions:
(1) Have the Velocity toolbar put special codes at the start and end of the
tag. (this is how DreamWeaver handles many built-in server behaviors).
This would work for VTL inserted with the tool, but not for that typed in
directly.
#set( $a = 10 ) #*set*#
(2) New syntax in Velocity that clearly marks the end of a directive (or
directive start, for a block) and cannot be nested.
#set < $a = 10 >
What do you think?
Cheers, WILL
----- Original Message -----
From: "Jason Gill" <[EMAIL PROTECTED]>
To: "Velocity Users List" <[EMAIL PROTECTED]>
Sent: Thursday, April 15, 2004 3:37 PM
Subject: RE: Dreamweaver Extension
> In your Configuration directory (in Windows "C:\Documents and
> Settings\****yourname****\Application Data\Macromedia\Dreamweaver MX
> 2004\Configuration\" where yourname is your windows login name) create a
new
> directory called "ThirdPartyTags" and add a 17x15 VTL.gif file containing
> your shield image. Next create an XML file in that same directory named
> VTL.xml with the following XML:
>
> <tagspec tag_name="vtl_set" start_string="#set" end_string=")"
> detect_in_attribute="true" icon="VTL.gif" icon_width="17"
> icon_height="15"></tagspec>
> <tagspec tag_name="vtl_include" start_string="#include" end_string=")"
> detect_in_attribute="true" icon="VTL.gif" icon_width="17"
> icon_height="15"></tagspec>
> <tagspec tag_name="vtl_parse" start_string="#parse" end_string=")"
> detect_in_attribute="true" icon="VTL.gif" icon_width="17"
> icon_height="15"></tagspec>
> <tagspec tag_name="vtl_if" start_string="#if" end_string="#end"
> detect_in_attribute="true" icon="VTL.gif" icon_width="17"
> icon_height="15"></tagspec>
> <tagspec tag_name="vtl_foreach" start_string="#foreach" end_string="#end"
> detect_in_attribute="true" icon="VTL.gif" icon_width="17"
> icon_height="15"></tagspec>
> <tagspec tag_name="vtl_stop" start_string="#st" end_string="op"
> detect_in_attribute="true" icon="VTL.gif" icon_width="17"
> icon_height="15"></tagspec>
> <tagspec tag_name="vtl_macro" start_string="#macro" end_string="#end"
> detect_in_attribute="true" icon="VTL.gif" icon_width="17"
> icon_height="15"></tagspec>
> <tagspec tag_name="vtl_comment" start_string="#*" end_string="*#"
> detect_in_attribute="true" icon="VTL.gif" icon_width="17"
> icon_height="15"></tagspec>
>
> Again, #if, #foreach, and #macro will break if another VTL tag is inside
of
> them, which is why I didn't add this to my extension in the first place. I
> guess I could go ahead and add everything but those 3 until we figure
> something else out, but I figured those are generally the most important
as
> far as needing ThirdPartyTag support anyway. What do you think?
>
> Jason
>
> -----Original Message-----
> From: White, Tim [mailto:[EMAIL PROTECTED]
> Sent: Thursday, April 15, 2004 1:52 PM
> To: Velocity Users List
> Subject: RE: Dreamweaver Extension
>
>
> So , how did you get it working?
>
> > -----Original Message-----
> > From: Jason Gill [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 15, 2004 1:13 PM
> > To: Velocity Users List
> > Subject: RE: Dreamweaver Extension
> >
> >
> > I messed around with that for a while, and I got it working.
> > The problem was when you had a statement within a statement,
> > Dreamweaver would see the first #end and quit, showing the
> > rest of your VTL after the shield. Most of the code that uses
> > that type of tag support wraps the entire block of code with
> > a certain tag i.e. <script> tag or <? php ?> etc.
> >
> > -----Original Message-----
> > From: White, Tim [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, April 15, 2004 8:55 AM
> > To: Velocity Users List
> > Subject: RE: Dreamweaver Extension
> >
> >
> > Jason, how does this work with Dreamweaver's third-party tag
> > support - i.e. making little shields out of the tags, and
> > ignoring the guts of the VTL?
> >
> > I've been wrestling with this for a while...
> >
> > Tim
> >
> > > -----Original Message-----
> > > From: Jason Gill [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, April 15, 2004 8:26 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Dreamweaver Extension
> > >
> > >
> > > I have posted a Velocity extension for Dreamweaver on Macromedia's
> > > website. If you use Dreamweaver with Velocity or would like
> > to, this
> > > extension might prove useful. Although I am a long time Dreamweaver
> > > user, I'm relatively new to VTL, so I am open to suggestions for
> > > addition, changes, etc. I just figured Dreamweaver needed
> > some type of
> > > Velocity support for us 'front end' guys.
> > >
> > http://www.macromedia.com/cfusion/exchange/index.cfm#loc=en_us
> &view=sn12
> 1&vi
> ewName=Dreamweaver%20Extension&authorid=0&page=0&scrollPos=0&subcatid=0&
> snid
> =sn121&itemnumber=-1&extid=1012541&catid=0
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]