Breadcrumb Implementation
25 posts by 4 authors in: Forums > CMS Builder
Last Post: October 22, 2012 (RSS)
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!
PHP Programmer - interactivetools.com
Re: [greg] Breadcrumb Implementation
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
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
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
By Jason - October 17, 2012
Sure. What you can do is use the $selectedCategory variable to output your breadcrumbs.
for example:
<?php echo @$selectedCategory['breadcrumbs'];?>
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
Ragi
northernpenguin
Northern Penguin Technologies
"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke
By Jason - October 18, 2012
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
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
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
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