ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Autocrumb - Lightweight Breadcrumb Helper (ver.12.05.1)

December 09, 2009 5:58pm

Subscribe [78]
  • #166 / Aug 23, 2011 7:25am

    ardinotow

    162 posts

    Hello,

    Thanks for the fantastic helper.

    Is it possible to add /index to the breadcrumb URLs?

    For example with my url suffix of .html:

    Currently autocrumb is pointing to /widgets/blue.html
    However is it possible to change this to /widgets/blue/index.html

    Second part of this question, is it possible to selectively do the above?
    /widgets/blue/104121421.html does not change to /widgets/blue/104121421/index.html

    On your config/breadcrumb.php, you may add the array after or before your original code

    $config['replacer'] = array('another key'=>'another value', 'blue' => array('/blue/index.html|blue'));

    Please read block comment above $config[‘replacer’] about Change URL feature for more references.

  • #167 / Aug 23, 2011 7:39am

    greebo

    4 posts

    Thanks very much for the fast reply, i have thousands of pages like this - is there any way to do this by uri segment number?

  • #168 / Aug 23, 2011 11:53am

    ardinotow

    162 posts

    Thanks very much for the fast reply, i have thousands of pages like this - is there any way to do this by uri segment number?

    Sorry greebo, to handle special treat like that could not be done by this helper right now :down:

  • #169 / Sep 12, 2011 5:42am

    tykho

    3 posts

    Great stuff.
    Might I ask what’s up with the strange version numbering? jumping back and forth..

    I’d like to use this helper, but I’m running a non english site with chars like Ä Å and Ö, and they are translated into A, A and O when put in titles. I also add an ID to the end, and I don’t want my breadcrumbs to look like
    localhost/item/vi-soker-en-fastighetsforvaltare-453
    But rather
    localhost/item/Vi Söker en Fastighetsförvaltare <- last part is the page title, picked from a variable sent by the controller.

    So what I’m wondering is, is it possible to remove the last segment on specific uri’s, like on localhost/item/x?

  • #170 / Sep 14, 2011 11:33am

    ardinotow

    162 posts

    Great stuff.
    Might I ask what’s up with the strange version numbering? jumping back and forth..

    I’d like to use this helper, but I’m running a non english site with chars like Ä Å and Ö, and they are translated into A, A and O when put in titles. I also add an ID to the end, and I don’t want my breadcrumbs to look like
    localhost/item/vi-soker-en-fastighetsforvaltare-453
    But rather
    localhost/item/Vi Söker en Fastighetsförvaltare <- last part is the page title, picked from a variable sent by the controller.

    So what I’m wondering is, is it possible to remove the last segment on specific uri’s, like on localhost/item/x?

    @tykho
    First, I’d like to say welcome to the communities! I remembered that I wrote my first post asking on other library thread, now you wrote your first post on my helper thread. next day maybe someone wrote one on your library/helper thread 😊

    For non english character, I afraid can not help you. On my code I do not change the font character, I only strip “-” or “_”.

    For second problem, you can use this code on config/breadcrumb.php

    $config['strip_regexp'] = array('/-[0-9]+/');
  • #171 / Sep 14, 2011 11:52am

    tykho

    3 posts

    Great stuff.
    Might I ask what’s up with the strange version numbering? jumping back and forth..

    I’d like to use this helper, but I’m running a non english site with chars like Ä Å and Ö, and they are translated into A, A and O when put in titles. I also add an ID to the end, and I don’t want my breadcrumbs to look like
    localhost/item/vi-soker-en-fastighetsforvaltare-453
    But rather
    localhost/item/Vi Söker en Fastighetsförvaltare <- last part is the page title, picked from a variable sent by the controller.

    So what I’m wondering is, is it possible to remove the last segment on specific uri’s, like on localhost/item/x?

    @tykho
    First, I’d like to say welcome to the communities! I remembered that I wrote my first post asking on other library thread, now you wrote your first post on my helper thread. next day maybe someone wrote one on your library/helper thread 😊

    For non english character, I afraid can not help you. On my code I do not change the font character, I only strip “-” or “_”.

    For second problem, you can use this code on config/breadcrumb.php

    $config['strip_regexp'] = array('/-[0-9]+/');

    Thanks for the reply!
    Hah, yeah, I sure hope so.

    I see. I guess I could strip everything right after /item/ with regex that way, hmh

  • #172 / Sep 15, 2011 4:55am

    imsoumya

    1 posts

    In my breadcrumb i need to add an dynamic text.Like replacing
    $config[‘replacer’] = array(‘Forum’ => ‘My_forum’, ‘Profile’ => ‘My_Profile’);
    suppose here if i want to replace the dynamically such that depending on some parameter i will get that set,

    Home > X_forum > X_Profile

    To get that what i need to do. Can you guide me please

  • #173 / Sep 18, 2011 3:50pm

    ardinotow

    162 posts

    In my breadcrumb i need to add an dynamic text.Like replacing
    $config[‘replacer’] = array(‘Forum’ => ‘My_forum’, ‘Profile’ => ‘My_Profile’);
    suppose here if i want to replace the dynamically such that depending on some parameter i will get that set,

    Home > X_forum > X_Profile

    To get that what i need to do. Can you guide me please

    Do you want to change $config[‘replacer’] value based on your criteria? If that what you want then the answer is no. $config[‘replacer’] is static value.

  • #174 / Sep 25, 2011 8:46pm

    elfuego1

    1 posts

    Hi,

    I’ve started using your amazing helper.
    For the moment it’s working this way: if I’m on my home page there is only HOME link available.
    If I go to my next page I have 2 links available: HOME | CHOOSE
    I wonder if it’s possible to set it this way: HOME | CHOOSE | CONTACT | ABOUT US | etc…
    so it would be constantly available on every page, nevermind visitor’s location?

    Best regards,
    Ender

  • #175 / Sep 25, 2011 10:42pm

    ardinotow

    162 posts

    Hi,

    I’ve started using your amazing helper.
    For the moment it’s working this way: if I’m on my home page there is only HOME link available.
    If I go to my next page I have 2 links available: HOME | CHOOSE
    I wonder if it’s possible to set it this way: HOME | CHOOSE | CONTACT | ABOUT US | etc…
    so it would be constantly available on every page, nevermind visitor’s location?

    Best regards,
    Ender

    Hi Ender,
    Why would you use this helper that way? Why not just using horizontal menu bar?

     

  • #176 / Nov 23, 2011 11:47am

    xcore

    2 posts

    Hi,

    I don’t know if I can post this question here, but I’m new to CI and I have a question about the “master template” that you put here:

    4. Add these line to your view file: <?php echo set_breadcrumb(); ?>. I suggest that you put it on master template so that it can save time as you don’t need to add text in every view page.

    Is there any link with an example that shows how to use an master template? The best way to create this type of templates? I couldn’t find anything on google about it.

    Another question: I can’t test this right now (i’m at work), but on function set_breadcrumb(), the second parameter (an array) is to exclude from the breadcrumb, right? Or the only way to exlude items is changing the config file?

    Thanks and congratulations for the helper!

    Sorry my bad english…

  • #177 / Nov 23, 2011 9:46pm

    ardinotow

    162 posts

    Hi,

    I don’t know if I can post this question here, but I’m new to CI and I have a question about the “master template” that you put here:

    4. Add these line to your view file: <?php echo set_breadcrumb(); ?>. I suggest that you put it on master template so that it can save time as you don’t need to add text in every view page.

    Is there any link with an example that shows how to use an master template? The best way to create this type of templates? I couldn’t find anything on google about it.

    Another question: I can’t test this right now (i’m at work), but on function set_breadcrumb(), the second parameter (an array) is to exclude from the breadcrumb, right? Or the only way to exlude items is changing the config file?

    Thanks and congratulations for the helper!

    Sorry my bad english…

    Let me explain as clearly as I can. Codeigniter basicaly consist of a controller with a view or some views.  Here the example from CI 2.0.3 user guide, a controller that using single view file (controllers/blog.php):

    <?php
    class Blog extends CI_Controller {
    
     function index()
     {
      $this->load->view('blogview');
     }
    }
    ?>

    To using autocrumb, you can put <?php echo set_breadcrumb(); ?> on header, body or wherever you want, here’s the example of views/blogview.php:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>My ERP</title>
        <link rel="stylesheet" href="<?php echo base_url();?>assets/css/blueprint/screen.css"     type="text/css" media="screen, projection">
    </head>
    <body>
        <div class="breadcrumb">
            <?php echo set_breadcrumb(); ?>   
        </div>
        <div class="container">
            This is content
        </div>
        <div class"footer">
            This is footer
        </div>
    </body>
    </html>

    If using that way then you should put <?php echo set_breadcrumb(); ?> on every page view. With multiple views you can avoid that situation by creating header.php, footer.php, or maybe sidebar.php, menu.php along with blogview.php. Now, you controller will be like this:

    <?php
    class Blog extends CI_Controller {
    
     function index()
     {
                $this->load->view('header');
                $this->load->view('blogview');
                $this->load->view('footer');
     }
    }
    ?>

    Strip header and footer content from views/blogview.php:

    <div class="container">
        This is content
    </div>

    The views/footer.php:

    <div class"footer">
            This is footer
        </div>
    </body>
    </html>

    For header, consider that header is always loaded and same for every page view then you can take benefit to put <?php echo set_breadcrumb(); ?> on header. See below example, views/header.php:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>My ERP</title>
        <link rel="stylesheet" href="<?php echo base_url();?>assets/css/blueprint/screen.css"     type="text/css" media="screen, projection">
    </head>
    <body>
        <div class="breadcrumb">
            <?php echo set_breadcrumb(); ?>   
        </div>

    That’s what I called as master template. So, we just need to put <?php echo set_breadcrumb(); ?> on views/header.php instead of that on every page view. Do you get it ?

    For the second question, yes you can exclude from set_breadcrumb parameter. The helper will search exclude variable from set_breadcrumb’s parameter first. If the parameter is empty then it will search value from config[‘exclude’] on config/breadcrumb.php

  • #178 / Nov 24, 2011 8:39am

    xcore

    2 posts

    Hi,

    Thanks a lot! I was thinking in something like that, but I thought that, maybe, I would use a “master template”
    without having to load the header and footer view in every method in my controller.

    Now another question:

    My url is:

    domain.com/city/controller/item

    Using the CI route configuration, the URL above calls:

    /controller/view/item

    The city is dynamic and available on my DB, so I’m getting this segment on my controller.

    So what I’m trying to do:

    - Raplace the /city/ for something more semantic (for SEO);
    - Exclude the breadcrumb that reffers to the controller (domain.com/city is routing to my controller already, have both will be redundant);

    So, I want my breadcrumb something like this:

    Home > Items in City > Item

    In my controller, in construct method, I’m using this:

    $this->load->config('breadcrumb');
    $this->config->set_item('replace', prepare_array_for_replace()); // replace city for Items in City
    $this->config->set_item('exclude', 'controller'); // exclude the Controller crumb

    The replacement is working fine, but the exlude, no…

    The result is: Home > Items in City > Controller > Item

    I’ll try later to replace the Controller for ‘’ and see if it works…

  • #179 / Dec 08, 2011 12:51pm

    Guardian

    5 posts

    How can I make multilanguage to work automatically instead of using the rewrite with something like

    $config['replacer'] = array('about' => 'about', 'references' => 'references', 'contacts' => 'contacts', ....);
  • #180 / Jan 01, 2012 8:51am

    hottiger

    2 posts

    Hi,

    If I have the following url:

    /foo/bar/8

    Is there a way to make it generate bar with the url /bar/8 ? So basically add the last segment to bar?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases