May 13 2010

Store Multi-Breadcrumbs

1120574_toast_2Many items that fall under many sections, Brands, categories and maybe price but all show the same Path or Bread Crumbs, in the Yahoo! Merchant solutions it will only show the Parent section that holds that item. There are a few options to showing the bread crumb trail and the one that I will be sharing today will be multi-breadcrumb.
With Multi-breadcrumb it will show all paths to that item and all will link back to the section that it came from, now this is not “live breadcrumbs” as that will take JavaScript to make it work and I don’t like to share JavaScript code because that will sometimes get hard but this is the same RTML that is used in Live breadcrumbs and can work for you if you know how to code it. I will be showing you how to modify the current breadcrumbs template to make this work.


Here is the breadcrumbs code in the stock form

Breadcrumbs ()
WHEN NOT OR
           EQUALS value1 @type
                  value2 :main.
           EQUALS value1 @type
                  value2 :norder.
           EQUALS value1 @type
                  value2 :empty.
           EQUALS value1 @type
                  value2 :privacypolicy.
           EQUALS value1 @type
                  value2 :info.
           EQUALS value1 @type
                  value2 :search.
  DIV class "breadcrumbs"
    WITH-LINK TO :index
      TEXT "Home"
    TEXT " > "
    FOR-EACH-OBJECT GET-PATH-TO dst id
                                src :index
                                nodst :t
                                nosrc :t
      WITH-LINK TO id
        TEXT @name
      TEXT " > "
    TEXT @name

and to change this to show all paths all we need to do is make it look like this

Breadcrumbs ()
FOR-EACH var path
         sequence GET-ALL-PATHS-TO dst id
                                   src :index
                                   nodst :t
                                   nosrc :t
				   maxpaths 3

  WHEN NOT OR
             EQUALS value1 @type
                    value2 :main.
             EQUALS value1 @type
                    value2 :norder.
             EQUALS value1 @type
                    value2 :empty.
             EQUALS value1 @type
                    value2 :privacypolicy.
             EQUALS value1 @type
                    value2 :info.
             EQUALS value1 @type
                    value2 :search.
    DIV class "breadcrumbs"
      WITH-LINK TO :index
        TEXT "Home"
      TEXT " > "
      FOR-EACH-OBJECT path
        WITH-LINK TO id
          TEXT @name
        TEXT " > "
      TEXT @name

This so as you can see we added the “FOR-EACH” operator with var to “path” then change the “FOR-EACH-OBJECT” operator to have “path” after it, and to do that click on the “GET-PATH-TO” and hit “cut” from there click on the “FOR-EACH-OBJECT” op and hit “edit” than type in “path” in the blank box. Now do you see the “maxpaths” you can change that to a number, any number and that will show that many Paths.

Here is the finished product

bcimages

2 Comments

  • By DaveNo Gravatar, May 22, 2011 @ 11:23 pm

    Does this still work with Yahoo Stores? I have tons of products in multiple categories and my products always seem to be showing up in my least preferred category.

    I tried to get this working but to be honest am new to RTML. Is there a step I am missing?

    WHEN NOT OR
    EQUALS value1 @type
    value2 :main.
    EQUALS value1 @type
    value2 :norder.
    EQUALS value1 @type
    value2 :empty.
    EQUALS value1 @type
    value2 :privacypolicy.
    EQUALS value1 @type
    value2 :info.
    EQUALS value1 @type
    value2 :search.
    DIV class “breadcrumbs”
    FOR-EACH var path
    sequence GET-ALL-PATHS-TO dst id
    src index
    nodst :t
    nosrc :t
    maxpaths 3
    WITH-LINK TO :index
    TEXT “Home”
    TEXT ” > ”
    FOR-EACH-OBJECT path
    WITH-LINK TO id
    TEXT @name
    TEXT ” > ”
    TEXT @name

    I am assuming the FOR-EACH is to be within DIV class “breadcrumbs”

  • By DaveNo Gravatar, May 23, 2011 @ 8:38 am

    Got it! Works great.

    Thank you!!!

Other Links to this Post

RSS feed for comments on this post.

Leave a comment

You must be logged in to post a comment.