You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Tim Colson <tc...@cisco.com> on 2004/03/18 19:34:55 UTC

RE: Layout w/ Model1 Velocity files (was: Application Flow? )

Rob -

> I'm trying to understand how to link pages together using velocity
> tiles. When using tiles I could use the insert tag to include my
> standard UI elements (header, footer,etc.). This scheme allowed me to
> add new pages pretty quickly. Here's what I am describing: 

It sounds like you're trying to build a model 1 type application using
direct links to pages, but still get a common layout.

I think the VelocityLayoutServlet in the Tools project can deliver on
that. 
http://jakarta.apache.org/velocity/tools/view/layoutservlet.html


FileA.vm
--------
I am file A -> link to <a href="FileB.vm">B</a>
#set ($page_title = "FileA")

FileB.vm
--------
I am file B -> link to <a href="FileA.vm">A</a>
#set ($page_title = "FileB")


Default.vm (default layout template)
---------
<html>
<head>
  <title>$!page_title</title>
</head>
<body>
  #parse('header.vm')
  $screen_content
  #parse('footer.vm')
</body>
</html>


Cheers,
Timo



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


RE: Layout w/ Model1 Velocity files (was: Application Flow? )

Posted by robevans <ro...@cisco.com>.
This looks like it should work. :-) 

Thanks for the fast response. 

> -----Original Message-----
> From: Tim Colson [mailto:tcolson@cisco.com] 
> Sent: Thursday, March 18, 2004 10:35 AM
> To: 'Velocity Users List'
> Subject: RE: Layout w/ Model1 Velocity files (was: Application Flow? )
> 
> 
> Rob -
> 
> > I'm trying to understand how to link pages together using velocity 
> > tiles. When using tiles I could use the insert tag to include my 
> > standard UI elements (header, footer,etc.). This scheme 
> allowed me to 
> > add new pages pretty quickly. Here's what I am describing:
> 
> It sounds like you're trying to build a model 1 type 
> application using direct links to pages, but still get a 
> common layout.
> 
> I think the VelocityLayoutServlet in the Tools project can 
> deliver on that. 
> http://jakarta.apache.org/velocity/tools/view/layoutservlet.html
> 
> 
> FileA.vm
> --------
> I am file A -> link to <a href="FileB.vm">B</a>
> #set ($page_title = "FileA")
> 
> FileB.vm
> --------
> I am file B -> link to <a href="FileA.vm">A</a>
> #set ($page_title = "FileB")
> 
> 
> Default.vm (default layout template)
> ---------
> <html>
> <head>
>   <title>$!page_title</title>
> </head>
> <body>
>   #parse('header.vm')
>   $screen_content
>   #parse('footer.vm')
> </body>
> </html>
> 
> 
> Cheers,
> Timo
> 
> 
> 
> ---------------------------------------------------------------------
> 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