1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-11 13:04:28 +02:00

Custom Page fixes and page breadcrumbs

This commit is contained in:
Cameron
2014-06-13 19:00:51 -07:00
parent 791608f0d7
commit 31e29bb892
5 changed files with 97 additions and 19 deletions

View File

@@ -440,6 +440,38 @@ class cpage_shortcodes extends e_shortcode
return '<a class="cpage btn btn-primary btn-chapter'.$inc.'" href="'.$url.'">'.$text.'</a>';
}
function sc_chapter_breadcrumb()
{
$tp = e107::getParser();
$breadcrumb = array();
$row = $this->getChapter();
$brow = $this->getBook($row['chapter_parent']);
if(empty($brow['chapter_sef']))
{
return;
}
$row['book_sef'] = vartrue($brow['chapter_sef'],"no-sef-found"); //$this->getBook();
$breadcrumb[] = array('text'=> $brow['chapter_name'], 'url'=> e107::getUrl()->create('page/book/index', $brow,'allow=chapter_id,chapter_sef,book_sef,page_sef'));
$breadcrumb[] = array('text'=> $row['chapter_name'], 'url'=> e107::getUrl()->create('page/chapter/index', $row,'allow=chapter_id,chapter_sef,book_sef'));
// $breadcrumb[] = array('text'=> $this->var['page_title'], 'url'=> null);
return e107::getForm()->breadcrumb($breadcrumb);
}
/**
* @example {CPAGERELATED: types=news}