#1 April 14, 2016 10:08am

mauriceRFU
Member
Registered: February 17, 2016
Posts: 2

Breadcrumb not being called for module.

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

#2 April 14, 2016 10:10am

timbuckingham
Administrator
From: Baltimore, MD
Registered: April 2, 2012
Posts: 978

Re: Breadcrumb not being called for module.

Did you set the template's "Related Module" to the module for the myEpisodes class?

Offline

#3 April 14, 2016 2:11pm

mauriceRFU
Member
Registered: February 17, 2016
Posts: 2

Re: Breadcrumb not being called for module.

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

Board footer

Powered by FluxBB

The Discussion Forum is not available on displays of this size.