Re: How to extend StrutsMenu?
Matt Raible <lists-T7vlz3gD7BdF/EzeuO4KJwC/[email protected]>
| Newsgroups | gmane.comp.java.struts-menu.user |
|---|---|
| Message-ID | <[email protected]> |
On Feb 1, 2005, at 11:43 AM, Ahmed Mohombe wrote: > Hi, > I would like to extend the StrutsMenu a little, but I can't find where > is the right place to start and do :(. It seems to me everything too > nested (because I don't know the framework). > > What I would like to change: > The generated menus (in the browser), look something like: > <li><a href="/help.html" title="Help">Help</a> > and this was generated from this config.xml: > <Item name="Help" title="Help" action="/help.html"/> > > I would like StrutsMenu to generate me additional HTML tag attributes, > especially an ID attribute: > <li id="myID"><a href="/help.html" title="Help">Help</a> OR > <li><a id="myID" href="/help.html" title="Help">Help</a> > from this config.xml: > <Item id="myID" name="Help" title="Help" action="/help.html"/> OR > <Item custom="myID" name="Help" title="Help" action="/help.html"/> (if > "id" is already taken) > > I would like to make this this for "velocity-nicetabs". > Has someone any hints or idea how/where to make the changes? Since you're using Velocity for your menu, you should be able to alter the template that you use for this menu. You could add a "name" attribute to the item and then use that in the "id" attribute of your link. > > Thanks in advance, > > Ahmed. > P.S. Is there a DTD for the menu config.xml (to allow xml editors to > check for the right syntax, and autocomplete for smarter editors :) ) > ? No, not right now. A few folks have submitted some, but they were just generated from their editors. I do need to create one and hope to as part of the next release. Matt ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl