Welcome Guest, Not a member yet? Register   Sign In
Autocrumb - Lightweight Breadcrumb Helper (ver.12.05.1)
#71

[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');
#72

[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?
#73

[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
#74

[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;
doesn't work.

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?
#75

[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)
Second step, remove last condition, so now you have this code in "if" statement:
Code:
if (preg_match("/^[0-9]/", $value) AND ! preg_match("/[a-zA-Z]+/", $value))
I haven't test it yet, but I think that will work.


Ardinoto W.
#76

[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.
#77

[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 Smile
#78

[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]))
{
    $show_last_number = $l_array;
}
Then change to:

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;
    $value_last_number = $uri_array_original[$l_array];
}
3. Find this code:
Code:
$str .= $delimiter.$wrapper_inline[0].anchor($new_segment_url, ucwords($val_name)).$wrapper_inline[1];
$k++;
Then change to:
Code:
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:
Code:
$str .= $delimiter.$wrapper_inline[0].anchor($segment, ucwords($value)).$wrapper_inline[1];
Then change to:
Code:
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

[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]))
{
    $show_last_number = $l_array;
}
Then change to:

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;
    $value_last_number = $uri_array_original[$l_array];
}
3. Find this code:
Code:
$str .= $delimiter.$wrapper_inline[0].anchor($new_segment_url, ucwords($val_name)).$wrapper_inline[1];
$k++;
Then change to:
Code:
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:
Code:
$str .= $delimiter.$wrapper_inline[0].anchor($segment, ucwords($value)).$wrapper_inline[1];
Then change to:
Code:
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.[/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
#80

[eluser]ardinotow[/eluser]
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.




Theme © iAndrew 2016 - Forum software by © MyBB