Breadcrumb Implementation

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

Hi Ragi,

I think I've found the problem. I've reuploaded squadronOperations.php and made the following changes to line 180:

<ul>
<?php foreach ($categoryRecords as $categoryRecord): ?>
<?php if ($categoryRecord['_isSelected']): ?>
<li><?php echo $categoryRecord['breadcrumb'] ; ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>


Let me know if this works for you.

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Breadcrumb Implementation

Nope!

Http://qc.aircadetleagueofcanada.ca/en/squadronOperations.php

All that shows is a small dark blue square. (Equivalent of 1space)

Ragi
--
northernpenguin
Northern Penguin Technologies

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

By Jason - October 17, 2012

Hi Ragi,

I took a look at the code. Can you tell me where $categoryRecords is being defined? It doesn't seem to be on the page.

What seems to be happening here is that there are no records inside $categoryRecords where "_isSelected" is getting set to true. Also, since squadronOperations.php appears to be a detail page for a single record section, it's unclear how breadcrumbs should work. Can you give an example of what breadcrumbs should look like on this page?

Thanks
---------------------------------------------------
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: since the menu as defined by $categoryRecords is required on all the website pages, it is defined in the include file php_common.inc which I attached in a previous posting above.

You can see the website at http://qc.aircadetleagueofcanada.ca/index.php

The menu structure is defined in CMSB and each menu is assigned to a file or a uri.

If you wish, I can provide you access to cmsb

Ragi
--
northernpenguin
Northern Penguin Technologies

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

Re: [Jason] Breadcrumb Implementation

Jason: didn't work. It's still outputting blank.

Ragi
--
northernpenguin
Northern Penguin Technologies

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

By Jason - October 18, 2012

Hi Ragi,

The issue here is that on your page you don't have a currently selected category. If you don't explicitly set which record you want as the selected category by using the "selectedCategoryNum" option in getCategories, the function defaults to the last record number in the URL string. In your example, there are no numbers in the URL, so $selectedCategory will always be empty. This also means that the "_isSelected" fields of your category records will always be 0.

When you are on that page, what category would you expect to see selected?

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: I would want it based on the 'name' field.

It should look like this for a 3rd level page:

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

Ragi
--
northernpenguin
Northern Penguin Technologies

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

By Jason - October 18, 2012

Hi Ragi,

So, are you trying to output all categories, and then show the breadcrumb for a selected category? The issue you're having right now is that no categories are being selected.
---------------------------------------------------
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: so, that must mean there is an issue with the menu (category). Since it actually works ( when I select a menu item I am directed to that specific page) there is something wrong based on the way the code for the menu is implemented.

Does that make sense? And how do I fix it?

Ragi
--
northernpenguin
Northern Penguin Technologies

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