ANSWERED: navigation breadcrumb helper
Permalink
using breadcrumb helper posted in developer docs here:
http://www.concrete5.org/documentation/developers/helpers/navigatio...
I opened up the php "page type" file located in the root of my theme, and pasted the snippet:
The breadcrumbs appear as desired, but the hyperlinks are not active:
http://sacredheart.saintstephenofhungary.net/sacraments/baptism/...
Keep in mind, I have a beginner level understanding of html/css and none whatsoever of pre-processor language.
As goes without saying, any help here is greatly appreciated.
http://www.concrete5.org/documentation/developers/helpers/navigatio...
I opened up the php "page type" file located in the root of my theme, and pasted the snippet:
The breadcrumbs appear as desired, but the hyperlinks are not active:
http://sacredheart.saintstephenofhungary.net/sacraments/baptism/...
Keep in mind, I have a beginner level understanding of html/css and none whatsoever of pre-processor language.
As goes without saying, any help here is greatly appreciated.
![ScottSandbakken](/files/avatars/92226.jpg)
You need to echo out the url as well as the collection name.
Thank you for the reply. I updated the code by changing the last line:
and was greeted with the following error:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /homepages/9/d395545664/htdocs/SacratissimumCorJesu/packages/respond/themes/respond/respond-left-sidebar.php on line 27
obviously, all greek to me.
I could simply use the "breadcrumbs" free add-on block, but I want to learn this stuff. Once I get a grip on html/css, its on to php, mysql and js. But for the time being, I'm left to grovel in the forums.
and was greeted with the following error:
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /homepages/9/d395545664/htdocs/SacratissimumCorJesu/packages/respond/themes/respond/respond-left-sidebar.php on line 27
obviously, all greek to me.
I could simply use the "breadcrumbs" free add-on block, but I want to learn this stuff. Once I get a grip on html/css, its on to php, mysql and js. But for the time being, I'm left to grovel in the forums.
You are missing a $bcpage in the last line (bcpage)
The great John the Fish. I am humbled, sir.
This thread should be subtitled "php for dummies". Because, all I understand at this point is that php is a redundant acronym.
Hence my need to ask, where do I put the "$bcpage"? Fill me in on the syntax.
Thank you for your attention.
This thread should be subtitled "php for dummies". Because, all I understand at this point is that php is a redundant acronym.
Hence my need to ask, where do I put the "$bcpage"? Fill me in on the syntax.
Thank you for your attention.
thank you for your help.
as per John the Fish's notation, you added the missing $ in front of bcpage. I figured that much out on my own. I pasted John's corrected snippet into my page file. Result shown here:
http://sacredheart.saintstephenofhungary.net/sacraments/baptism/...
I am doing something wrong, no doubt.
as per John the Fish's notation, you added the missing $ in front of bcpage. I figured that much out on my own. I pasted John's corrected snippet into my page file. Result shown here:
http://sacredheart.saintstephenofhungary.net/sacraments/baptism/...
I am doing something wrong, no doubt.
<?php $nh = Loader::helper('navigation'); $breadcrumb = $nh->getTrailToCollection($c); krsort($breadcrumb); foreach ($breadcrumb as $bcpage) { echo '<a href="' . $bcpage->url . '">' . $bcpage->getCollectionName() . '</a> > '; } echo '<a href="' . $bcpage->url . '" class="active">' . $bcpage->getCollectionName() . '</a>'; ?>
Dear Sir,
Thank you so much for looking at this for me.
your code gives me:
home > parent > parent
. . .with all three linked to the current page. Oops.
desired breadcrumbs should be:
home > parent > current child
. . .linked to their appropriate page, obviously.
current conundrum:
http://sacredheart.saintstephenofhungary.net/sacraments/baptism/...
Thank you so much for looking at this for me.
your code gives me:
home > parent > parent
. . .with all three linked to the current page. Oops.
desired breadcrumbs should be:
home > parent > current child
. . .linked to their appropriate page, obviously.
current conundrum:
http://sacredheart.saintstephenofhungary.net/sacraments/baptism/...
<?php $c = Page::getCurrentPage(); // You may not need this $nh = Loader::helper('navigation'); $breadcrumb = $nh->getTrailToCollection($c); krsort($breadcrumb); foreach ($breadcrumb as $bcpage) { echo '<a href="' . $bcpage->url . '">' . $bcpage->getCollectionName() . '</a> > '; } echo '<a href="' . $c->url . '" class="active">' . $c->getCollectionName() . '</a>'; ?>
Dear Scott,
that renders:
home > parent > current child
. . .but all three remain linked to the current child
here:
http://sacredheart.saintstephenofhungary.net/sacraments/anointing-s...
hmph!
that renders:
home > parent > current child
. . .but all three remain linked to the current child
here:
http://sacredheart.saintstephenofhungary.net/sacraments/anointing-s...
hmph!
Try this:
<?php $c = Page::getCurrentPage(); // You may not need this $nh = Loader::helper('navigation'); $breadcrumb = $nh->getTrailToCollection($c); krsort($breadcrumb); foreach ($breadcrumb as $bcpage) { echo '<a href="' . $nh->getCollectionURL($bcpage) . '">' . $bcpage->getCollectionName() . '</a> > '; } echo '<a href="' . $nh->getCollectionURL($c) . '" class="active">' . $c->getCollectionName() . '</a>'; ?>
Scott, aka NetJunky:
Thanks a million. That's the one. Breadcrumbs are now hardcoded into my site thanks to your selfless contribution.
Godspeed!
Thanks a million. That's the one. Breadcrumbs are now hardcoded into my site thanks to your selfless contribution.
Godspeed!