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]
  • #76 / May 21, 2010 3:25am

    chefnelone

    157 posts

    Thanks Ardionoto. It worked.

    I’ve got other question:

    Now:
    http://192.00.00/simetria/tienda/34/Colecciones/228
    produce: Home > Tienda > Colecciones

    The link for ‘Colecciones’ is:
    http://192.00.00/simetria/tienda/Colecciones

    but I need this url instead:
    http://192.00.00/simetria/tienda/Colecciones/228

    Is there any way to do this? I mean using a segment in the ‘link’ which is not shown in the breadcrumb.

  • #77 / May 21, 2010 6:39am

    stikoo

    5 posts

    Hi Ali,

    Since the number 2 and ‘anchor fittings’ are dynamic, I suggest something else:

    1- figure out a way to add ‘anchor fittings’ to your url; it should look something like ‘.../site/products  
      /2/anchor fittings’
    2- then edit your config file with $config[‘exclude_segment’] = array(1, 2, 3); that should hide ‘/site
      /products/2’
    3- I believe your breadcrumb will be what you’re looking for after the above 2 steps.

    All the best!

    Benjo


    Right I’ll give that a go Benjo,

    That sounds like a good idea actually 😊

  • #78 / May 21, 2010 6:46am

    ardinotow

    162 posts

    Hi chefnelone,

    Try this step:
    1. Follow modification from your previous problem.
    2. Find this code:

    if (preg_match("/^[0-9]/", $uri_array_original[$l_array]) AND ! preg_match("/[a-zA-Z]+/", $uri_array_original[$l_array]))
    {
        $show_last_number = $l_array;
    }

    Then change to:

    if (preg_match("/^[0-9]/", $uri_array_original[$l_array]) AND ! preg_match("/[a-zA-Z]+/", $uri_array_original[$l_array]))
    {
        $show_last_number = $l_array;
        $value_last_number = $uri_array_original[$l_array];
    }

    3. Find this code:

    $str .= $delimiter.$wrapper_inline[0].anchor($new_segment_url, ucwords($val_name)).$wrapper_inline[1];
    $k++;

    Then change to:

    if ($i == $number_array-2 && $show_last_number > 0)
    {
        $new_segment_url = $new_segment_url.$value_last_number;
    }
    $str .= $delimiter.$wrapper_inline[0].anchor($new_segment_url, ucwords($val_name)).$wrapper_inline[1];
    $k++;

    4. For the last step, also find this code:

    $str .= $delimiter.$wrapper_inline[0].anchor($segment, ucwords($value)).$wrapper_inline[1];

    Then change to:

    if ($i == $number_array-2 && $show_last_number > 0)
    {
        $segment = $segment.$value_last_number;
    }
    $str .= $delimiter.$wrapper_inline[0].anchor($segment, ucwords($value)).$wrapper_inline[1];

    It’s such a long step for modification but I hope you can have URL as expected.


    Ardinoto W.

  • #79 / May 21, 2010 11:44am

    chefnelone

    157 posts

    Hi chefnelone,

    Try this step:
    1. Follow modification from your previous problem.
    2. Find this code:

    if (preg_match("/^[0-9]/", $uri_array_original[$l_array]) AND ! preg_match("/[a-zA-Z]+/", $uri_array_original[$l_array]))
    {
        $show_last_number = $l_array;
    }

    Then change to:

    if (preg_match("/^[0-9]/", $uri_array_original[$l_array]) AND ! preg_match("/[a-zA-Z]+/", $uri_array_original[$l_array]))
    {
        $show_last_number = $l_array;
        $value_last_number = $uri_array_original[$l_array];
    }

    3. Find this code:

    $str .= $delimiter.$wrapper_inline[0].anchor($new_segment_url, ucwords($val_name)).$wrapper_inline[1];
    $k++;

    Then change to:

    if ($i == $number_array-2 && $show_last_number > 0)
    {
        $new_segment_url = $new_segment_url.$value_last_number;
    }
    $str .= $delimiter.$wrapper_inline[0].anchor($new_segment_url, ucwords($val_name)).$wrapper_inline[1];
    $k++;

    4. For the last step, also find this code:

    $str .= $delimiter.$wrapper_inline[0].anchor($segment, ucwords($value)).$wrapper_inline[1];

    Then change to:

    if ($i == $number_array-2 && $show_last_number > 0)
    {
        $segment = $segment.$value_last_number;
    }
    $str .= $delimiter.$wrapper_inline[0].anchor($segment, ucwords($value)).$wrapper_inline[1];

    It’s such a long step for modification but I hope you can have URL as expected.


    Ardinoto W.

    I really appreciate you taking the time for the fix.
    It worked like a charm for the example I left in my post.

    Anyway I wish I can do it by using Replacer ($config[‘replacer’]) because now I need to do a similar thing with others segments.

    thanks

  • #80 / May 22, 2010 12:41pm

    ardinotow

    162 posts

    chefnelone,

    Maybe you should read Benjo’s suggestions to Ali Man’s problem here. Look at point number 1 that show an ideal url pattern to autoCRUMB.

  • #81 / Jun 15, 2010 4:13pm

    Archa

    1 posts

    Hi, is there any way to unlink segment by name?
    I got http://localhost/gallery/category/photo/32

    And Dreadcrumb
    Home > Gallery > Photo > 32

    I want to unlink Photo, got someone any ideas?


    —-
    Peace

  • #82 / Jun 21, 2010 1:55pm

    phederic

    3 posts

    you are a genius! thanks!!!!!

  • #83 / Jun 21, 2010 3:55pm

    cahva

    662 posts

    Hi, is there any way to unlink segment by name?
    I got http://localhost/gallery/category/photo/32

    And Dreadcrumb
    Home > Gallery > Photo > 32

    I want to unlink Photo, got someone any ideas?

    In the current autocrumb no, but fortunately I needed the same so I added the feature to it 😊

    I made a fork of it and you can find it here:
    http://bitbucket.org/cahva/codeigniter-autocrumb

  • #84 / Aug 19, 2010 2:18am

    ardinotow

    162 posts

    Just noticed a bug on first breadcrumb link. Using replacer on first breadcrumb link will cause URL link have the same word that replace it. Anyway, bug has been fixed. Get the source here: http://bitbucket.org/ardinotow/autocrumb

    Happy Fasting to all Muslims all over the world!

  • #85 / Aug 19, 2010 10:31am

    carnalito

    22 posts

    Hi,

    you did:

    if ($j == 0)
                    {
                        $uri_array = array_replace($uri_array_original, $replacement);
                    }

    and “corrected” this to:

    if ($j = 0)
                    {
                        $uri_array = array_replace($uri_array_original, $replacement);
                    }

    This new code is allways true, so why using this if-statement?!

  • #86 / Aug 20, 2010 8:48am

    ardinotow

    162 posts

    Thanks for reviewing my code. No, It’s not always true because if-statement is inside foreach-loop. Is that what you mean?

  • #87 / Aug 20, 2010 10:39am

    carnalito

    22 posts

    Hi,

    you are welcome.

    No this is not what i mean. Your statement is a assignment, so $j = 0 is allways true, because the value of $j is now 0.

    Know what i mean?

  • #88 / Aug 20, 2010 10:51am

    danmontgomery

    1802 posts

    $j=0 never evaluates to true. The assignment operator doesn’t return a value based on success, the statement evaluates to the new value of $j.

    if($j=0)
    // is
    if(0)

    which is always false.

  • #89 / Aug 20, 2010 3:24pm

    carnalito

    22 posts

    i never used this statement in an if-construct - i assumed that it is true.

    Nevertheless, the code is not good…

  • #90 / Aug 20, 2010 10:28pm

    ardinotow

    162 posts

    The code is a bit complicated because using many array loops and replacements. Sure, code is not clear enough and looks ugly for some people but I try my best to make this helper more easier to use.

    Cheers

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

ExpressionEngine News!

#eecms, #events, #releases