I'm trying to make a simple user macro where I can display the breadcrumbs of a page anywhere on that page. Can someone help me with this one?
Community moderators have prevented the ability to post new answers.
This should help you get started:
#set($globalHelper = $action.getHelper())
$globalHelper.getBreadcrumbs()
That gets a Java ArrayList of PageBreadcrumb objects. Here's the API for the PageBreadcrumb class:
hth,
matt
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bake more bread :)
It's for a customer who wants templates with some information about the page (breadcrumbs, no. of attachments etc) in a "header". They will also export these pages to pdf.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any chance, you could share your final user macro here?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
##
@noparams
## MACRO: bcrumbs
## Updated:
2011
-
03
-
15
## Breadcrumbzz
## USAGE: {bcrumbs}
#set($globalHelper = $action.getHelper())
#set($breezys = $globalHelper.getBreadcrumbs())
#set ($counter =
0
)
## iterate over each breadcrumb
#foreach( $breadcrumb in $breezys)
#set ($displayTitle = $breadcrumb.getDisplayTitle())
#
if
($counter ==
0
) #
else
$displayTitle > #end
## increment the counter
#set($counter = $counter +
1
)
#end ## end foreach
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry to draw up an old thread, how would you expand this to make the breadcrumbs clickable / links?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks a million!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sure thing. Just out of curiousity, what are you going to do with the breadcrumbs?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.