Welcome Guest, Not a member yet? Register   Sign In
Problem in implementing breadcrumbs
#1

[eluser]bhakti.thakkar[/eluser]
Hello all,
i have downloaded DTE-BreadCrumbs version 1.8 and done as per the instructions. But i am getting this error.

Fatal error: BreadCrumbList::display() [<a href='function.BreadCrumbList-display'>function.BreadCrumbList-display</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition &quot;BreadCrumb&quot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /var/www/CUI_CI/system/application/libraries/Breadcrumblist.php on line 59

In my autoload.php:
Code:
$autoload['libraries'] = array('session','Pearloader','Dbconnect','site_sentry','breadcrumb','breadcrumblist');

$autoload['helper'] = array('url' , 'file');

In config.php
Code:
$config['breadcrumbDelimiter'] = "&raquo;";

home controller:

Code:
function test2(){
        $bc = array(
               'title' => 'Test 2',
               'url' => 'home/test2',
               'isRoot' => false
        );

        $this->breadcrumb->setBreadCrumb($bc);

        $data = array(
               'title' => 'My Title',
               'content' => 'home',
               'breadcrumbs'=>get_Instance()->breadcrumblist->display()
        );


    //    $this->load->view('products/product_view',$data);
    }
2 libraries are there in application/libraries
what could be possible mistake?


Thanks in anticipation
#2

[eluser]ericsodt[/eluser]
For shits and giggles, put the breadcrumb and breadcrumblist objects in front of 'Pearloader','Dbconnect','site_sentry'. Could it be that one of these three classes are error-ing out, causing the breadcrumblist object to not load correctly?? Just a guess...

Try removing those 3 classes and see if it works without them, if it does, you know there's an issue with something in those classes. As you can see from my demo site and the many of other users that have left comments, my breadcrumbs do work, its just a matter of debugging on your part to find out what is hindering the breadcrumblist object from being instantiated correctly



[quote author="bhakti.thakkar" date="1270810565"]Hello all,
i have downloaded DTE-BreadCrumbs version 1.8 and done as per the instructions. But i am getting this error.

Fatal error: BreadCrumbList::display() [<a href='function.BreadCrumbList-display'>function.BreadCrumbList-display</a>]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition &quot;BreadCrumb&quot; of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /var/www/CUI_CI/system/application/libraries/Breadcrumblist.php on line 59

In my autoload.php:
Code:
$autoload['libraries'] = array('session','Pearloader','Dbconnect','site_sentry','breadcrumb','breadcrumblist');

$autoload['helper'] = array('url' , 'file');

In config.php
Code:
$config['breadcrumbDelimiter'] = "&raquo;";

home controller:

Code:
function test2(){
        $bc = array(
               'title' => 'Test 2',
               'url' => 'home/test2',
               'isRoot' => false
        );

        $this->breadcrumb->setBreadCrumb($bc);

        $data = array(
               'title' => 'My Title',
               'content' => 'home',
               'breadcrumbs'=>get_Instance()->breadcrumblist->display()
        );


    //    $this->load->view('products/product_view',$data);
    }
2 libraries are there in application/libraries
what could be possible mistake?


Thanks in anticipation[/quote]
#3

[eluser]bhakti.thakkar[/eluser]
Thanks ericsodt,
Its working now. I tried it with your suggestion and it works like charms. But still there is one problem. there is no hyperlink on the title.
ofcourse i have autoloaded the url helper in the config file
Below is the code in the controller:
Code:
function service_view(){
        $bc = array(
                   'title' => 'Service',
                   'url' => 'services/service_view',
                   'isRoot' => true
            );
            $this->breadcrumb->setBreadCrumb($bc);

            $data = array(
               'breadcrumbs'=>get_Instance()->breadcrumblist->display()
            );
        $data['page_header'] = 'Service > Service view';
        $data['option_add'] = 'services/service_add';
        $data['page_data'] = $this->service_model->get_all_services();
        $this->load->view('admin/services/service_view',$data);
    }
#4

[eluser]ericsodt[/eluser]
[quote author="bhakti.thakkar" date="1271072861"]Thanks ericsodt,
Its working now. I tried it with your suggestion and it works like charms. But still there is one problem. there is no hyperlink on the title.
ofcourse i have autoloaded the url helper in the config file
Below is the code in the controller:
Code:
function service_view(){
        $bc = array(
                   'title' => 'Service',
                   'url' => 'services/service_view',
                   'isRoot' => true
            );
            $this->breadcrumb->setBreadCrumb($bc);

            $data = array(
               'breadcrumbs'=>get_Instance()->breadcrumblist->display()
            );
        $data['page_header'] = 'Service > Service view';
        $data['option_add'] = 'services/service_add';
        $data['page_data'] = $this->service_model->get_all_services();
        $this->load->view('admin/services/service_view',$data);
    }
[/quote]

Have you looked at my demo page? Only the pages leading up to the current position will be hyperlinks. The current page will be displayed as regular text.

For example:

Home -> User -> Profile

User and Home will be links, however Profile will not be a link since this is your current page.

Please put your code somewhere on the net and link back to it so I can take a look at it

Thank you
#5

[eluser]bhakti.thakkar[/eluser]
Okay ericsodt,
I will do that and inform you...Thanks for all the help




Theme © iAndrew 2016 - Forum software by © MyBB