Bread crumbs In grails
I want to know the usage and implementation of the bread crumbs in grails.
i have some gsp(view) pages ,Home page is default i have 6 categories and in that 6 sub pages i need to show the navigation path in my pageslike
home/grocery/sub grocery.... home/finance/subfinance...
i need to show the page navigation.
<div id="heder_content">
<g:if test="${session.user }">
<div id="bread_crumbs"style="position:absolute;top:0px;left:474px;height:80px;width:800px">
</div>
</div>
</g:if>
What would you like to achieve exactly? You can try creating a taglib where you read the controller name and the action, and passing some parameters you can display the name of your product for example. I mean something like this:
<g:breadcrumb title="${product.name}" />
and in your taglib file:
class BreadCrumbTagLib {
def breadcrumb = { attrs ->
def title=attrs.remove('title')
out << '''<div id="bread_crumbs"style="position:absolute;top:0px;left:474px;height:80px;width:800px">${controllerName} / ${actionName} / ${title} </div>'''
}
}
My example is very simple, but I hope you get the idea! If you need something more complex, I suggest you to get a look at: http://adityakalia.wordpress.com/2011/01/10/breadcrumbs-framework-for-grails/
链接地址: http://www.djcxy.com/p/6656.html上一篇: Spring MVC上的Spring Web Flow
下一篇: 面包屑在grails中