velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Edgar" <robert.ed...@eeplace.com>
Subject RE: Dynamic Nested Templates -Don't Agree that this is not what Velo is for
Date Sun, 11 Nov 2001 02:05:21 GMT
Guys,
Maybe I didn't explain myself clearly, my fault!

No problem, anyway here is my "take" on things.

I understand that Velocity is a templating engine, we are currently using
XSL as our templating engine, I have a standard "template" which is a large
XSL stylesheet, actually I have several "standard" templates covering
different sorts of pages that I have on my web site. Within a standard
template I then load sub-templates to format different sections, so on my
site home page I have the main page template and sub templates for a section
on latest news .

Now to me this is EXACTLY what velocity is about.

The only issue I had here was that Velocity "seemed" to require a template
to be fixed rather than dynamic in that although it can have nested
templates, using the #parse directive, these are preset in the template
whereas I wanted something dynamic in that a template will display a VAR at
a point in the template but I want the VAR to be the output of #parse some
previous template.

AND

After looking a bit father myself it "seems" to me my "standard" templates
can be loaded as Velocity Macro's in the form of the global library. My
understanding is that a Macro is called and is passed parameters which can
be anything including the rendered output of another template. If that is
the case that almost exactly matches an XSL call-template directive.

So ....  correct me if I am wrong .... but to me this is exactly what Velo
is about and it can do what I want...

Rob


-----Original Message-----
From: Geir Magnusson Jr. [mailto:geirm@optonline.net]
Sent: Sunday, November 11, 2001 4:36 AM
To: velocity-user@jakarta.apache.org
Subject: Re: Dynamic Nested Templates


On 11/10/01 2:46 PM, "LS" <alphafoo@yahoo.com> wrote:

> Robert, I think what you are looking for is a web development framework.
> Velocity,
> on the other hand, is a templating engine that happens to work very well
with
> web
> frameworks. Several web frameworks exist, and I can recommend Maverick as
a
> very
> small, simple, free, and usable way to wrap a framework around Velocity
pages.
> Turbine, also from the Jakarta project, performs this role, along with
doing a
> lot
> of other things.
>
> Geir et al, I wonder if it makes sense to write up a quick blurb on this
topic
> and
> put it somewhere visible, like Velocity FAQ?

That's a good idea.  Will do.

>
> --- Robert Edgar <robert.edgar@eeplace.com> wrote:
>> I am trying to convert existing pages that use xsl into Velocity.
>>
>> What I want to know is how to implment the following style in Velocity...
>>
>> <xsl:template match="/page">
>> <xsl:call-template name="stdPage">
>> <xsl:with-param name="SideBar">
>> <xsl:call-template name="SideBar"/>
>> </xsl:with-param>
>> <xsl:with-param name="panelC">
>> <xsl:call-template name="FeatureBoxes" />
>> </xsl:with-param>
>> <xsl:with-param name="panelR">
>> <xsl:call-template name="banner125">
>> <xsl:with-param name="index" select="2"/>
>> </xsl:call-template>
>> <xsl:call-template name="banner125">
>> <xsl:with-param name="index" select="3"/>
>> </xsl:call-template>
>> <xsl:call-template name="banner125">
>> <xsl:with-param name="index" select="4"/>
>> </xsl:call-template>
>> </xsl:with-param>
>> </xsl:call-template>
>> </xsl:template>
>>
>> If it isn't obvious what I have is a global template which is a standard
>> page with a left,center and right columns which I will fill with the
>> contents of parsing other templates. ie I want to call a template and
pass
>> it a parameter which is the result of parsing another template.
>>
>> I cant see how this is done in Velocity.
>>
>>
>> Rob
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail:
>> <mailto:velocity-user-help@jakarta.apache.org>
>>
>
>
> __________________________________________________
> Do You Yahoo!?
> Find a job, post your resume.
> http://careers.yahoo.com
>
> --
> To unsubscribe, e-mail:
> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:velocity-user-help@jakarta.apache.org>
>

--
Geir Magnusson Jr.                       geirm@optonline.net
System and Software Consulting
You're going to end up getting pissed at your software
anyway, so you might as well not pay for it. Try Open Source.



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




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


Mime
View raw message