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

By northernpenguin - October 18, 2012 - edited: October 18, 2012

Jason: This is weird. The menu works properly except for the Home page, where is displays "Record not found!". All other menu entries work properly.

As for the breadcrumb trail, here is what I am using:
<ul>

<li><?php @$selectedCategory['breadcrumb']; ?></li>

</ul>

and it still outputs nothing.

I also tried:


Ragi<ul>
<?php if ($categoryRecord['_isSelected']): ?>
<li><?php echo $categoryRecord['name']; ?></li>
<?php endif; ?>
</ul>

Still nothing.
--
northernpenguin
Northern Penguin Technologies

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

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

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