Breadcrumbs / Page Title

Hello,

I’m currently working with the rffSnCiNavBreadcrumbs and trying to implement that onto my site. The code works fine except but the breadcrumbs seem to stop on the title of the landing page and not the page title of the page itself. I’ve tried other methods and can’t seem to find anything that works. Here’s the hierarchy of my site:


ROOT Folder
     Parent Folder
     Parent Folder
     Parent Folder
          Child Folder
               Grandchild NavOn
               Grandchild Page 1 (index page)
               Grandchild Page 2 (link from index)
               Grandchild Page 3 (link from index)
      ( and so on... )

It displays fine on Grandchild Page 1 - which is the index page of the folder (also the page the navon points to). However, Grandchild Pages 2 & 3, which are just hyperlinks from page 1, do not display their titles. It just displays the navon’s title. I’m not sure if $nav is what I should be using or not.

Has anyone had this or similar problems, can point me in the right direction, or suggest any Navigation Documentation pages?

Any help is appreciated.

thank you.

Managed navigation works best when each page in the breadcrumbs has its own navon which links to it, and its own folder. If the pages aren’t landing pages, I don’t think they will show up in the breadcrumbs.

page in the breadcrumbs has its own navon which links to it, and its own folder
WOW… each “page” needs to be its own abstract data type each with a generic template and navon all in a folder.

Thanks mdmcginn. You’ve confirmed my hunches :slight_smile:

This isn’t quite accurate. Let me try and explain a bit more about Managed Nav.

The original concept was that each section of a site will have a “landing page”, and when you go to that section, the landing page is “where you land”. The navigation was designed to work section by section. I think in your case you have this working as designed.

There are some people who want to extend Navigation to every leaf page. One approach is simply to put EVERY page in it’s own folder, but this doesn’t work very well: there are too many folders, and when ever you change ANY page title (or add or remove a page) you must do a full publish to get the navigation to be correct.

A better way is to use Managed Nav to build your navigation from the “folder up” and use a folder auto index to list all items in the current folder. Normally, this is applied to the Left Nav rather than the breadcrumbs, but I don’t see why you couldn’t use this technique.

Of course, I’m not sure why you want the title of the current page in the breadcrumbs: it doesn’t seem like it adds anything as the title of the page should already be displayed.

Dave

We’ve figured out how to add content items to navigation (other than navons/bases). The code is still pretty messy, but it works quite well. If you would like/are still interested, I can post it here.

An added benefit was that items that are not in the public state, won’t show up in the navigation (ie. not tied to a navon). Obviously this is only for “single” pages and pages that have “sub-items” should still be in a separate folder with its own navon.

Of course we still have the problem with the navigation changes, but we have just told end users that if anything major changes in the navigation, wait till their scheduled full publish is triggered to see the change propagated…

If you want to do to get the landing page’s actual page (as opposed to the navon):


//....(code to get to the particular submenu that contains your landing page)
#foreach ($navon in $submenu)
  // you probably want to check the axis and what not to make sure that you are in the right page
  #set($landingPage = $navon.getProperty('nav:landingPage').getNode())
  #set($pagetitle= $landingPage.getProperty("rx:displaytitle").String)
  $pagetitle
  // more stuff here
#end
//...

Great. I haven’t tried a folder auto list for navigation, but that sounds helpful.

The idea of including the current page in the breadcrumbs is modeled by Jakob Nielsen, whom the New York Times has called “the guru of Web page usability.”

Dave does have a point. there really is no benefit to adding the page title in the breadcrumbs since it’s already displayed as a page title header. i guess my concern was for users who are 3 or 4 or 5 folders deep to be able to navigate their way back.

here’s the solution i’ve made peace with:


#slot("rffNav" "" "" "" "" "template=myBreadcrumbs") > #field("displaytitle")



it’s a little crude, i know. it’s like an itch i can’t reach. but since the only thing that was missing was the page title, i’ve just added that field twice as both the page header and the breadcrumb tail. not sure if this will be a problem down the road but for now it seems to work.

i also modified my original breadcrumbs so that the page title won’t show twice for navon pages.

thanks for bouncing ideas

I did the same thing as ldavid.

Hi Don

The only downside to your approach is that the last folder in the breadcrumb trail and the displaytitle tend to the same so you end up duplicating items.

You can get around this by adding a condition to your breadcrumb navigation to check the self node against the displaytitle of the page and if the same then only display one of them.

Cheers
James

hey jimbo,

my understanding is that the Breadcrumbs slot is independent of my generic template (where i’m calling the breadcrumbs slot from). i cannot call any page variables from one template to the other. If i could compare the two, I would just display the current page title at the end of my breadcrumb nav… which is what i can’t do – unless each page was in it’s own folder, etc, etc.

is there another command other than #field(“displaytitle”) that i can put in my breadcrumb nav to call the page title of my pages?

For getting stuff from something that isn’t the current item, you might find some inspiration from these posts:

The source for the #slot macros, such as node_slot, uses similar code, such as $rx.location.generate, $sys.assemblyItem.clone() and setNode .

Hi Don

is there another command other than #field(“displaytitle”) that i can put in my breadcrumb nav to call the page title of my pages?

No but any binding variables that are set in a global template are also visible in the local template.

In the global template:

$displaytitle = $sys.item.getPropety("rx:displaytitle").String

Local nav template:

#if (node.getPropety("rx:displaytitle").String != $displaytitle)
  
#end

This will only work when previewing the template with the global and not just the nav template itself.

Cheers
J

Hey Jimbo,

I can’t get that code to work. But then again, I’ve only been on it for about 20min. I’m determined to get it to work. Right now, whenever i declare the $displaytitle in either my global or local templates, it just displays the declaration statement. (I’m assuming it’s done with the #set() and not just a straight “=”.)

Hi Don

Sorry dont think I made it that clear, the variable has to be set in the bindings.

Cheers
James

Hey James,

That is AWSOME!!! it works. I’ve got a bit of logic issues to get everything to display properly but other than that, I think we got something going here.

Thanks everyone for your posts.

-don