Autocrumb - Lightweight Breadcrumb Helper (ver.12.05.1) |
[eluser]Benjo[/eluser]
Hello there, Assuming you have your 'Home' at 'http://www.somesite.co.uk/index.php/', try these lines of code in your breadcrumb.php... $config['replacer'] = array('2' => 'Anchor Fittings'); $config['exclude'] = array('site','products');
[eluser]stikoo[/eluser]
Hi Benjo That theory works in only one instance really, because the number 2, and "anchor fittings" are dynamic values, it would be impossible for me to keep the breadcrumb config file updates with the new values for the other categories. for some reason the first snippet you supplied didn't work either, not sure why. Anyone else got ideas?
[eluser]Benjo[/eluser]
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
[eluser]chefnelone[/eluser]
Hello This is a great helper! I've found this: If the last segmente is a number, then: Code: $config['hide_number'] = TRUE; http://192.00.00/simetria/tienda/34/Colecciones/228 produce: Home > Tienda > Colecciones > 228 It worked fine with the 3rd segment /34/ but no with the last one /228/ Edited: Sorry I just saw the note line: * Notes: If the last segment is a number then it always shown whether this config Is there a way to change this?
[eluser]ardinotow[/eluser]
Hi chefnelone, To show number at last segment of URL you can try this: First, find these code: Code: if (preg_match("/^[0-9]/", $value) AND ! preg_match("/[a-zA-Z]+/", $value) AND $key != $show_last_number) Code: if (preg_match("/^[0-9]/", $value) AND ! preg_match("/[a-zA-Z]+/", $value)) Ardinoto W.
[eluser]chefnelone[/eluser]
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.
[eluser]stikoo[/eluser]
[quote author="Benjo" date="1274381008"]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[/quote] Right I'll give that a go Benjo, That sounds like a good idea actually
[eluser]ardinotow[/eluser]
Hi chefnelone, Try this step: 1. Follow modification from your previous problem. 2. Find this code: Code: if (preg_match("/^[0-9]/", $uri_array_original[$l_array]) AND ! preg_match("/[a-zA-Z]+/", $uri_array_original[$l_array])) Code: if (preg_match("/^[0-9]/", $uri_array_original[$l_array]) AND ! preg_match("/[a-zA-Z]+/", $uri_array_original[$l_array])) Code: $str .= $delimiter.$wrapper_inline[0].anchor($new_segment_url, ucwords($val_name)).$wrapper_inline[1]; Code: if ($i == $number_array-2 && $show_last_number > 0) Code: $str .= $delimiter.$wrapper_inline[0].anchor($segment, ucwords($value)).$wrapper_inline[1]; Code: if ($i == $number_array-2 && $show_last_number > 0) It's such a long step for modification but I hope you can have URL as expected. Ardinoto W.
[eluser]chefnelone[/eluser]
[quote author="ardinotow" date="1274453160"]Hi chefnelone, Try this step: 1. Follow modification from your previous problem. 2. Find this code: Code: if (preg_match("/^[0-9]/", $uri_array_original[$l_array]) AND ! preg_match("/[a-zA-Z]+/", $uri_array_original[$l_array])) Code: if (preg_match("/^[0-9]/", $uri_array_original[$l_array]) AND ! preg_match("/[a-zA-Z]+/", $uri_array_original[$l_array])) Code: $str .= $delimiter.$wrapper_inline[0].anchor($new_segment_url, ucwords($val_name)).$wrapper_inline[1]; Code: if ($i == $number_array-2 && $show_last_number > 0) Code: $str .= $delimiter.$wrapper_inline[0].anchor($segment, ucwords($value)).$wrapper_inline[1]; Code: if ($i == $number_array-2 && $show_last_number > 0) It's such a long step for modification but I hope you can have URL as expected. Ardinoto W.[/quote] 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
|
Welcome Guest, Not a member yet? Register Sign In |