Breadcrumb Implementation

25 posts by 4 authors in: Forums > CMS Builder
Last Post: October 22, 2012   (RSS)

By Jason - October 18, 2012

Hi Ragi,

One thing you can do is append a record number to the end of your URL. This should then get picked up by getCategories and make a $selectedRecord variable available to you.

For example:
<a href="<?php echo $categoryRecord['url'] ?>?<?php echo $categoryRecord['num'];?>" rel="self"><?php echo $categoryRecord['name'] ?></a>

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Breadcrumb Implementation

Jason: Correct me if I'm wrong, but from what I am looking at here is what I must be able to do in order to display the correct breadcrumb trail:

Based on the current 'num', lookup 'lineage'. 'lineage' stores the complete breadcrumb trail as follows (ex): ":1:2:47"

That means I have to parse the value of 'lineage' and display record num = 1 > num = 2 > num =47 using the 'title'.

Does that make sense?

Ragi
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

By Jason - October 19, 2012

Hi Ragi,

The breadcrumb field does do a bit of this work for you it will give you a separated string of names, based on lineage. It includes itself at the end, so you would get a breadcrumb value that looked similar to this:


About the League : Chairperson's Message :Chairperson's Biography

The issue, however, is that you are getting no record for $selectedCategory, so there is nothing to output. If you could send in a [url http://www.interactivetools.com/support]2nd Level support[/url] request, I can take a quick look at what is going on. If no obvious solution presents itself, this may be something we can help you out with through consulting.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Breadcrumb Implementation

Thanks Jason. It works.

Here is Jason's solution:
I've got a basic implementation of the breadcrumbs working for you on squadronOperations.php. The problem was that a selectedCategoryNum wasn't being passed into the getCategories section and so the isSelected field wasn't being set by the function. To get around this I've used the 'num' value from the Menu section for Squadron operations instead of 'isSelected' to find the correct $categoryRecords row in the array.

If your planning on adding this code to your other pages you will need to get the Record Number from the Menu section for the appropriate record, and then replace the number four on line 182 with the your new record number.


Now, my only remaining problem is how to implement the breadcrumb trail on the French side of the web site. Unfortunately, the breadcrumb content is only in English.

Oh well, if I didn't have something challenging to work on I would be bored!

Ragi
[cool]
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke