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

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