Add block functionality to another block
Permalink
Hi, I'm trying to add a breadcrumb into a banner than I've made with Designer Content. I've put the breadcrumb php code into my block which is:
And added the classes from the autonav controller into my controller after tweaking their names so that they aren't redeclared:
and I'm getting the following error:
Anyone know why I might be getting this since all I'm doing is copying the autonav functionality?
Thank you in advance!
$navItems = $controller->getNavItems(true); for ($i = 0; $i < count($navItems); $i++) { $ni = $navItems[$i]; if ($i > 0) { echo ' <span class="ccm-autonav-breadcrumb-sep">></span> '; } if ($ni->isCurrent) { echo $ni->name; } else { echo '<a href="' . $ni->url . '" target="' . $ni->target . '">' . $ni->name . '</a>'; } }
And added the classes from the autonav controller into my controller after tweaking their names so that they aren't redeclared:
class AutonavBlockControllerCustom extends Concrete5_Controller_Block_Autonav { } class AutonavBlockItemCustom extends Concrete5_Controller_Block_AutonavItem { }
and I'm getting the following error:
Fatal error: Call to undefined method BannerWithTextBlockController::getNavItems() in /home/www/dev/www.bedrockdrilling.co.uk/blocks/banner_with_text/view.php on line 2
Anyone know why I might be getting this since all I'm doing is copying the autonav functionality?
Thank you in advance!