Sorry I don't understand you, could you put an example please? Alex F El 29/12/2009 22:14, Alexandre Andrade escribió: > I make a new version, "Full Breadcrumb" for applications that use > nested functions, where you want the user pass by a function first to > go to another, so you can set the parent functions, getting the > history of navigation or hide the own function > > http://www.web2pyslices.com/main/slices/take_slice/47 > > 2009/12/29 Richard <[email protected] <mailto:[email protected]>> > > neat! > > > On Dec 29, 7:45 am, Alexandre Andrade <[email protected] > <mailto:[email protected]>> > wrote: > > I improved the function and put it > athttp://www.web2pyslices.com/main/slices/take_slice/46 > <http://www.web2pyslices.com/main/slices/take_slice/46> > > > > Features: > > > > - links in every breadcrumb > > - can set a breadcrumb to args > > - can localize/personalize the controllers - using T() > > > > Thanks to Richard <richardbp(at)gmail.com <http://gmail.com>>, > for original function that I > > made improvements > > > > Put in your model/module: > > [image: Select] > > > > def breadcrumbs(arg_title=None): > > "Create breadcrumb links for current request" > > # make links pretty by capitalizing and using 'home' > instead of 'default' > > #pretty = lambda s: s.replace('default', > 'InÃcio').replace('_', > > ' ').capitalize() > > menus = [A(T('Home'), _href=URL(r=request, c='default', > f='index'))] > > if request.controller != 'default': > > # add link to current controller > > menus.append(A(T(pretty(request.controller)), > > _href=URL(r=request, c=request.controller, f='index'))) > > if request.function == 'index': > > # are at root of controller > > menus[-1] = A(T(pretty(request.controller)), > > _href=URL(r=request, c=request.controller, f=request.function)) > > else: > > # are at function within controller > > menus.append(A(T(pretty(request.function)), > > _href=URL(r=request, c=request.controller, f=request.function))) > > # you can set a title putting using breadcrumbs('My > Detail Title') > > if request.args and arg_title: > > menus.append(A(T(arg_title)), _href=URL(r=request, > > c=request.controller, f=request.function,args=[request.args])) > > else: > > #menus.append(A(pretty(request.controller), > > _href=URL(r=request, c=request.controller, f='index'))) > > if request.function == 'index': > > # are at root of controller > > #menus[-1] = pretty(request.controller) > > pass > > #menus.append(A(pretty(request.controller), > > _href=URL(r=request, c=request.controller, f=request.function))) > > else: > > # are at function within controller > > menus.append(A(T(pretty(request.function)), > > _href=URL(r=request, c=request.controller, f=request.function))) > > # you can set a title putting using breadcrumbs('My > Detail Title') > > if request.args and arg_title: > > menus.append(A(T(arg_title), _href=URL(r=request, > > f=request.function,args=[request.args]))) > > > > return XML(' > '.join(str(m) for m in menus)) > > > > To use, put in your view: > > [image: Select] > > > > {{=breadcrumbs() }} > > > > or > > [image: Select] > > > > {{=breadcrumbs('My Title for request.args ') }} > > > > ------------------------------------------------------------ > > 2009/8/7 Richard <[email protected] <mailto:[email protected]>> > > > > > > > > > > > > > > > > > hi Alex, > > > > > I am now using this automatic breadcrumb function: > > > > > def breadcrumbs(): > > > "Create breadcrumb links for current request" > > > # make links pretty by capitalizing and using 'home' instead of > > > 'default' > > > pretty = lambda s: s.replace('default', 'home').replace('_', ' > > > ').capitalize() > > > menus = [A('Home', _href=URL(r=request, c='default', > f='index'))] > > > if request.controller != 'default': > > > # add link to current controller > > > menus.append(A(pretty(request.controller), _href=URL > > > (r=request, c=request.controller, f='index'))) > > > if request.function == 'index': > > > # are at root of controller > > > menus[-1] = pretty(request.controller) > > > else: > > > # are at function within controller > > > menus.append(pretty(request.function)) > > > return XML(' > '.join(str(m) for m in menus)) > > > > > Has anyone else got a system they can share? > > > Richard > > > > > On Aug 5, 10:48 am, Richard <[email protected] > <mailto:[email protected]>> wrote: > > > > On Jul 17, 10:52 am, Alex Fanjul <[email protected] > <mailto:[email protected]>> wrote: > > > > > > > I agree with you Richard, > > > > > In deed, in statusbar there is already a "kind of > breadcrumb" but > > > > > wihtout links... > > > > > > > A vote for this inbuild functionallity... > > > > > Otherwise, I bet that someone has a quick and simple idea > to do this > > > > > with one function and getting the information from url > app, controller, > > > > > function. > > > > > > hmm, doing it automatically from the URL might work for me > if I plan > > > > it right. > > > > Does anyone else already have their own breadcrumb system? > > > > > > Richard > > > --~--~---------~--~----~------------~-------~--~----~ > > > You received this message because you are subscribed to the > Google Groups > > > "web2py-users" group. > > > To post to this group, send email to [email protected] > <mailto:[email protected]> > > > To unsubscribe from this group, send email to > > > [email protected] > > <mailto:web2py%[email protected]><web2py%[email protected] > <mailto:web2py%[email protected]>> > > > For more options, visit this group at > > >http://groups.google.com/group/web2py?hl=en > > > -~----------~----~----~----~------~----~------~--~--- > > > > -- > > Atenciosamente > > > > -- > > ========================= > > Alexandre Andrade > > Hipercenter.com > > -- > > You received this message because you are subscribed to the Google > Groups "web2py-users" group. > To post to this group, send email to [email protected] > <mailto:[email protected]>. > To unsubscribe from this group, send email to > [email protected] > <mailto:web2py%[email protected]>. > For more options, visit this group at > http://groups.google.com/group/web2py?hl=en. > > > > > > -- > Atenciosamente > > -- > ========================= > Alexandre Andrade > Hipercenter.com > > -- > > You received this message because you are subscribed to the Google > Groups "web2py-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/web2py?hl=en.
-- Alejandro Fanjul Fdez. [email protected] www.mhproject.org -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

