You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thinh Doan <td...@twjconsulting.com> on 2001/09/18 00:35:03 UTC

template usage for vertical and horizontal menu

My question is at the end of the msg after I present the background.  Thx.

I'd like to create 2 templates: one with the menu on the left side and one
with the menu on top horizontally.

e.g
1) template_v.jsp
<%@ taglib uri='/WEB-INF/tlds/template.tld' prefix='template' %>
<html><head><title><template:get name='title'/></title></head>
<body>
<table>
   <tr valign='top'><td><template:get name='menu'/></td>
      <td><table>
            <tr><td><template:get name='header'/></td></tr>
            <tr><td><template:get name='content'/></td></tr>
            <tr><td><template:get name='footer'/></td></tr>
         </table>
      </td>
   </tr>
</table>
</body></html>

and
2) template_h.jsp
<%@ taglib uri='/WEB-INF/tlds/template.tld' prefix='template' %>
<html><head><title><template:get name='title'/></title></head>
<body>
<table>
   <tr><td><template:get name='header'/></td></tr>
   <tr><td><template:get name='menu'/></td></tr>
   <tr><td><template:get name='content'/></td></tr>
   <tr><td><template:get name='footer'/></td></tr>
</table>
</body></html>


In using these templates for the menu, I'd code
...
  <template:put name='menu' content='/menu.jsp' />
...

Question:
Do I have to have 2 menu.jsps, one for the vertical layout and one for the
horizontal layout?  It'd be more "elegant" if menu.jsp just contains a list
of menu items (+ links) and the template would retrieve it and layout it
correctly.  If you have any suggestions on how to do it, I'd appreciate it
very much.

Thank you for your time and help.

Thinh