Adam Hardy wrote:

Jason,
it just occurred to me (must have had my eyes shut) after a couple of weeks that the last breadcrumb in the breadcrumb menu done with your tiles method is actually a link to the page that you are already on.


Is this the way you have implemented it, or have I done it wrong?



Yes, it is a link to that page. Or at in some cases it has been the link to the list page for some admin pages. Eg list of users, when they select a user to edit i leave the breadcrumb as 'Users' and if they click on it, it goes back to the user list.

Adam



On 02/23/2004 11:27 PM Jason Lea wrote:


Andy Engle wrote:



Hi all,

Is there any slick way of putting breadcrumbs into a web app with
Struts?  If so, what's the preferred way?

Thanks.


Andy



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]






I did this using tiles. I have my tiles extending a base layout, then each sub-menu item extends the parent tile definition
eg
(first level)
<definition name=".main.admin" extends=".layout">
...
</definition>


(second level)
<definition name=".main.admin.workflow.list" extends=".main.admin">
...
</definition>

Now, for breadcrumbs I would define breadcrumb0 in the first level. As the second level extends the first, breadcrumb0 will be included. In the second level I define breadcrumb1

eg
<definition name=".main.admin" extends=".layout">
      <put name="title"  value="admin.title" />
      <put name="body"  value="/WEB-INF/jsp/tiles/admin/admin.jsp" />
      <putList name="breadcrumb0" >
          <item value="admin.menu"
              link="admin"
              tooltip="admin.title"
              classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
      </putList>
  </definition>

<definition name=".main.admin.workflow.list" extends=".main.admin">
<put name="title" value="workflow.list.title" />
<put name="body" value="/WEB-INF/jsp/tiles/admin/workflow/list.jsp" />
<putList name="breadcrumb1" >
<item value="workflow.menu"
link="workflowlist"
tooltip="workflow.title"
classtype="org.apache.struts.tiles.beans.SimpleMenuItem" />
</putList> </definition>


I had originally wanted to just to be able to add an item to the breadcrumb list, but that is not possible in xml. In my layout.jsp page I then use

<tiles:useAttribute name="breadcrumb0" ignore="true" />
<tiles:useAttribute name="breadcrumb1" ignore="true" />
<tiles:useAttribute name="breadcrumb2" ignore="true" />

<!-- breadcrumbs -->
<div class="breadcrumbs">
<span class="breadcrumb mainnavitem"><html:link forward="homepage" titleKey="homepage.title"><bean:message key="homepage.menu" /></html:link></span>
</c:forEach>


<c:forEach items="${breadcrumb0}" var="crumb">
<span class="breadcrumb mainnavitem"><bean:message key="breadcrumb.separator" /> <html:link forward="${crumb.link}" titleKey="${crumb.tooltip}"><bean:message key="${crumb.value}" /></html:link></span>
</c:forEach>


<c:forEach items="${breadcrumb1}" var="crumb">
<span class="breadcrumb mainnavitem"><bean:message key="breadcrumb.separator" /> <html:link forward="${crumb.link}" titleKey="${crumb.tooltip}"><bean:message key="${crumb.value}" /></html:link></span>
</c:forEach>


<c:forEach items="${breadcrumb2}" var="crumb">
<span class="breadcrumb mainnavitem"><bean:message key="breadcrumb.separator" /> <html:link forward="${crumb.link}" titleKey="${crumb.tooltip}"><bean:message key="${crumb.value}" /></html:link></span>
</c:forEach>
</div>
<!-- end breadcrumbs -->


Hope that make somes sort of sense. If not ask me a question and I will try to explain better.









--
Jason Lea



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to