dear all,
i tried to use #...@vmname() to write pages those imports another layout, and i
did as follows:
first, i defined a macro named 'layoutAs' in a macro.vm:
#macro(layoutAs $layout)
#parse($layout)
#end
then, i wrote 2 files, a.vpage and b.vpage
=====a.vpage=====
#...@layoutas("b.vpage")
this is a string in a.vpage
#end
=====b.vpage=====
<div style="color:red">
$!bodyContent
</div>
yes, it worked. however, when i modified b.vpage, let it use another layout:
=====b.vpage=====
#...@layoutas("c.vpage")
<div style="color:red">
$!bodyContent
</div>
#end
=====c.vapge=====
<table border="1">
<tr>
<td>$!bodyContent</td>
</tr>
</table>
as a result, a.vpage can not be rendered properly.
is it a bug of velcocity or not? i really need a simple way to realize such
purpose
2010-04-29
bluejoe2008