I needed a solution without core edit this time. I found this topic and saw that I actually didn't post that solution, but I said I will. Well, more than a half year later, it's here.
Example of Violet theme and one of my plugins.
oc-content/themes/violet/header.php
<?php
if(function_exists('userreview_install') && Rewrite::newInstance()->get_location() == 'userreview') { // Use Params or Rewrite class to determine your pages.
userreview_breadcrumb(); // Custom plugin breadcrumb.
} else {
// This is default breadcrumb code.
$breadcrumb = osc_breadcrumb('»', false);
if( $breadcrumb != '') {
echo $breadcrumb;
}
}
?>
In my case, oc-content/plugins/zo_userreview/helpers/hUserReview.php. In yours probably oc-content/themes/violet/functions.php.
<?php
function userreview_breadcrumb() {
$breadcrumb = new Breadcrumb(); // Initialise Breadcrumb class.
$level1 = array(
'url' => osc_base_url(),
'title' => osc_page_title()
);
$breadcrumb->addLevel($level1); // Add first level with page title.
$route = Params::getParam('route'); // Get route.
switch($route) { // Pick title based of route.
case 'userreview-add': // If route is "userreview-add".
$user_id = Params::getParam('id');
$user_name = userreview_get_subject();
$level2 = array(
'url' => osc_user_public_profile_url($user_id), // URL
'title' => $user_name // Title
);
$breadcrumb->addLevel($level2); // Add second level, user name (e.g. John).
$level3 = array(
'title' => __('Add a review', 'zo_userreview') // Title. No URL because this is the last level.
);
$breadcrumb->addLevel($level3); // Add third level, 'All reviews'.
break;
case 'userreview-all-list':
$level2 = array(
'title' => __('All reviews', 'zo_userreview') // Title. No URL because this is the last level.
);
$breadcrumb->addLevel($level2); // Add second level, 'All reviews'.
break;
}
echo $breadcrumb->render(); // Show the breadcrumb.
}
@Resta, a simplified solution for you would look like this. Bender theme.
oc-content/themes/bender/header.php
<?php if(Params::getParam('slug') == 'YOUR PAGE SLUG') {
$breadcrumb = new Breadcrumb();
$level1 = array(
'url' => osc_base_url(),
'title' => osc_page_title()
);
$breadcrumb->addLevel($level1); // Add page title - first level.
$breadcrumb = new Breadcrumb();
$level1 = array(
'title' => 'YOUR CUSTOM TITLE' // Only TITLE, as this is last level.
);
$breadcrumb->addLevel($level1);
$breadcrumb->render();
?>
<div class="breadcrumb">
<div class="clear"></div>
</div>
<?php } else {
$breadcrumb = osc_breadcrumb('»', false, get_breadcrumb_lang());
if( $breadcrumb !== '') { ?>
<div class="breadcrumb">
<?php echo $breadcrumb; ?>
<div class="clear"></div>
</div>
<?php }
} ?>
Sorry for waiting and messy code...
Regards.