velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Praveen Ray <>
Subject calling same macro in multiple pages
Date Wed, 19 Oct 2005 02:31:13 GMT
Hi All
I'm trying to abstract the common layout in one .vm file
like this:

<div> #parse( "header.vm" ) </div>
<div> #body() </div>
<div> #parse( "footer.vm") </div>

#macro( body )
This is Home Page
goto <a href='/myinfo'>My Info</a>
#parse( "layout.vm")

#macro( body )
This is My Info
#parse( "layout.vm")

As you can see the general layout of the site has been
abstracted into layout.vm and each individual template is 
just generating the content for the main body. Although
nice scheme, this doesn't work. The homepage displays
properly, however clicking on 'My Info' link on the home,
takes you a screen which has same content as the body of
the homepage. It's, as if, the #body macro from homepage is
used to render myinfo page. Looks like similar named macros
from different pages are not unique?

Is this kind of stuff even doable in Velocity? If yes, what
am I doing wrong? If not, can someone please suggest an
alternate way of abstracting the layout in one file?

  - Praveen  

Yahoo! Mail - PC Magazine Editors' Choice 2005

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message