You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Matthias Wessendorf <mw...@pironet-ndh.com> on 2005/04/11 12:11:31 UTC

Parser and Context

Hi,

if I do something like with Context object, all is fine:

ctx.put("navigation","<a href=\"http://foo\">A LINK</a>");


But what I really want is:

ctx.put("navigation","#parse (\"navigation.vm\")");

Because I want in my *master* template something like:

<html>
<body>
<table><tr><td>$navigation</td>
...
</html>

So that I have no *hard* coded parse inside that template,
since navigation page can be different by some use cases.

Any idea for something like that?

thanks,
Matthias

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


AW: Parser and Context

Posted by Markus <e9...@student.tuwien.ac.at>.
Hi,

could this be an idea?
ctx.put("navigation", "http://foo/");

then <html>.....
<td>#parse("navigation.vm")</td>

and in the template named "navigation.vm" you have:
<a href="$navigation">A LINK</a>

Markus

> -----Ursprüngliche Nachricht-----
> Von: Matthias Wessendorf [mailto:mwessendorf@pironet-ndh.com]
> Gesendet: Montag, 11. April 2005 11:12
> An: velocity-user@jakarta.apache.org
> Betreff: Parser and Context
>
>
> Hi,
>
> if I do something like with Context object, all is fine:
>
> ctx.put("navigation","<a href=\"http://foo\">A LINK</a>");
>
>
> But what I really want is:
>
> ctx.put("navigation","#parse (\"navigation.vm\")");
>
> Because I want in my *master* template something like:
>
> <html>
> <body>
> <table><tr><td>$navigation</td>
> ...
> </html>
>
> So that I have no *hard* coded parse inside that template,
> since navigation page can be different by some use cases.
>
> Any idea for something like that?
>
> thanks,
> Matthias
>
> ---------------------------------------------------------------------
> 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