I guess this question was asked a few times, but I haven't seen an
answer/solution with Click that works :( :
Is it possible to Decorate Click pages with the border-template.htm vs.
the actual "inclusion" of the page in the border-template.htm using the
#parse($page) Velocity macro?
The actual Click approach works very well for simple
templates(border-template.htm ), but more complex ones are hard to
make/maintain, hence the requirement to "decorate" (inject their content).
One framework that allows to arbitrarily decorate web pages (even remote
ones) is Sitemesh (the new sitemesh3 http://www.sitemesh.org/)
http://www.opensymphony.com/sitemesh/
but unfortunately I have no idea how to use it with Click it a way that
Click still keeps all it's fantastic functionality :(.
The "decoration" (like Sitemesh does) requirement is quite common where
the Template needs to change (e.g. in the case of the CMS, Blog, or
applications that allow customer branding), and it might have a strange
structure and requires several insertion points for the content from
pages - e.g. left column, right column, etc.
E.g. for the EditUserPage.java page edit-user.htm:
-------------
$form
$addUserButton
-------------
the $form needs to go in one DIV of the border-template.htm, but the
$adduserButton needs to go to another div (e.g. on the right) - those
DIVs might be separated from another with several DIVS or nested or
contain some more things, or there might be a table there, so I can't
write in edit-user.htm something like:
---------
<div id="center"> $form </div>
<div id="left"> $addUserButton </div>
--------
because that would break and mess up with the structure of the
border-template.htm (that should be the only place the layout takes place).
Click allows only one insertion point: in the DIV where
#parse($page) takes place :(.
Using "decoration" it would be possible to insert different parts of
edit-user.htm to different places of the border-template.htm, but how?
Any ideas how to achieve this with Click would be highly appreciated.
regards,
Andrei.