You are not logged in.
Pages: 1
So I'm working on a custom module that has both individual episodes and an archive page.
I'm trying to get the breadcrumbs to display differently depending on if you're on the archive or episode.
This is the code I have thus far:
class myEpisodes extends BigTreeModule {
var $Table = "mytable";
var $CategoryTable = "my_categories";
var $RelTable = "mytable_to_categories";
var $PageLink = "";
public function __construct() {
global $cms;
$this->PageLink = $cms->getLink(40);
}
public function get($item) {
$item = parent::get($item);
$item["link"] = $this->PageLink . $item["route"] . "/";
return $item;
}
public function getBreadcrumb($page) {
global $bigtree;
$bc = array();
if ($bigtree["routed_path"][0] == "archive") {
$bc[] = array(
"title" => "Archive",
"link" => "#"
);
} else if (isset($bigtree["commands"][0])) {
$episode = $this->getByRoute($bigtree["commands"][0]);
if ($episode) {
$bc[] = array(
"title" => $episode["title"],
"link" => "#"
);
}
}
return $bc;
}
}
?>
The constructor function and get functions work fine. They're called no problem.
The get breadcrumb function isn't being called. At all. I don't know why. Anyone have any thoughts?
Offline
Did you set the template's "Related Module" to the module for the myEpisodes class?
Offline
Thank you soo much.
The class name was misspelled in the developers section in big tree.
That fixed it.
Last edited by mauriceRFU (April 14, 2016 2:21pm)
Offline
Pages: 1