On 11/29/2011 08:59 AM, Niall Loughnane wrote:
Hi,



Is there a way in Velocity Templates to imbed other velocity templates?



I have the following velocity template "mypage_html.vm",
"
<html>
     <body>
          text to be displayed

     </body>

</html>

"



For reusability purposes I want to have 2 base velocity templates:

"mypage_html_header.vm":
"
<html>

     <body>
"

"mypage_html_footer.vm":

"
     </body>


</html>
"



Then to refactor "mypage_html.vm" to:
"
#include mypage_html_header.vm
          text to be displayed


#include mypage_html_footer.vm

"



Is this possible in Velocity Templates?


Yes, see http://velocity.apache.org/engine/releases/velocity-1.7/vtl-reference-guide.html#aparse_-_Renders_a_local_template_that_is_parsed_by_Velocity

#parse('mypage_html_header.vm')
text to be displayed
#parse('mypage_html_footer.vm')

--
Sergiu Dumitriu
http://purl.org/net/sergiu/

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to