Part of the EllisLab Network
   
3 of 20
3
Autocrumb - Lightweight Breadcrumb Helper (ver.12.05.1)
Posted: 04 February 2010 10:38 PM   [ Ignore ]   [ # 21 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  03-19-2008

** Autocrumb | Breadcrumb Helper 2.0.0 **

New Features:
1. Hide or show numbers in crumbs result.

$config[‘hide_number’] = TRUE;

If set to TRUE then any number without a word in a segment will be hide.
Example: mysite.com/blog/2009/08/7-habbits/
will have breadcrumbs: Home > Blog > 7 Habbits
Otherwise if set to FALSE it will produce: Home > Blog > 2009 > 08 > 7 Habbits
Notes: If the last segment is a number then it always shown whether this config
set to TRUE or FALSE.

2. Minor bug fixes: removes trailing slash from last segment.

Regards,
Ardinoto Wahono

PS:
- Open helpers/breadcrumb_helper.php to see installation guides.
- Configuration with detail descriptions is store in config/breadcrumb.php.

File Attachments
breadcrumb_helper_2.0.0.zip  (File Size: 5KB - Downloads: 328)
 Signature 

AutoACL - Access Control Library++ with Very Private Page (VPP) Control
AutoCRUMB - The simplest breadcrumb helper ever
Autocrumb on bitbucket
Integrate CI 2 with Eclipse
———————————————————————————————-
Website: ardinoto.blogspot.com

Profile
 
 
Posted: 18 February 2010 05:06 PM   [ Ignore ]   [ # 22 ]  
Lab Assistant
RankRank
Total Posts:  166
Joined  01-03-2010

@ardinotw, still a question about the last crumb

how can i make domain.com/artwork/street/bansky-tray-300.html

look like
Home >> artwork >> street >> banksy tray
in the breadcrumbs

Now it looks like
Home >> Artwork >> Street >> Banksy Tray 300 Html


But i like to keep domain.com/artwork/street/all/25
domain.com/artwork/street/all/50

for navigation

home >> artwork >> street >> all >> 25

home >> artwork >> street >> all >> 50
something like this

$lastcrumbstr_replace("html"""$lastcrumb);
            
           
$lastcrumbereg_replace("[0-9]"""$lastcrumb); 
 Signature 

burak: Skinny controllers Fat models

Profile
 
 
Posted: 19 February 2010 01:03 PM   [ Ignore ]   [ # 23 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  03-19-2008

@123wesweat,
For html file extension problem, you can add these into config/breadcrumb.php

$config['strip_characters'= array ('_''-''.html''.php'); 

All characters in array will be stripped from breadcrumb.
Also make this revision to helpers/breadcrumb_helper.php

$char_to_replace $CI->config->item('strip_characters'); 

Last segment in the url always shown even if it contain only number. So you can get home >> artwork >> street >> all >> 25 without any hacks.

FYI, ereg_replace is deprecated and not supported on newer version of PHP.

In domain.com/artwork/street/bansky-tray-300.html, is 300 a static or dynamic value? Why you put 300 in a last crumb and why you need to remove it? I want to generalized the problem before make a troubleshooting for your problem.

 Signature 

AutoACL - Access Control Library++ with Very Private Page (VPP) Control
AutoCRUMB - The simplest breadcrumb helper ever
Autocrumb on bitbucket
Integrate CI 2 with Eclipse
———————————————————————————————-
Website: ardinoto.blogspot.com

Profile
 
 
Posted: 19 February 2010 01:41 PM   [ Ignore ]   [ # 24 ]  
Lab Assistant
RankRank
Total Posts:  166
Joined  01-03-2010

@ardinotow, tx for your fast handling i will try your suggestions.

About domain.com/artwork/street/bansky-tray-300.html,
300 is an unique dynamic value which i used in a form. I just want the breadcrumb look pretty and informative.

 Signature 

burak: Skinny controllers Fat models

Profile
 
 
Posted: 20 February 2010 01:39 AM   [ Ignore ]   [ # 25 ]  
Lab Assistant
RankRank
Total Posts:  166
Joined  01-03-2010

@ardinotow,

not there yet. Your suggestion didn’t work

i config i have added

$config['strip_characters'= array ('_''-''.html''.php''html'); 

adding html did strip html from the bread crumb
but 300 still stays, so now i have

Home Artwork Street Bansky Tray 300 

and is still like to get

Home Artwork Street Bansky Tray 

breadcrumb_helper from line 162

foreach ($uri_array as $value)
        
{
            
if ($i 0)
            
{
                $segment 
.= $uri_array_original[$i].'/';

                
// Skip link if replace value is null
                
if (! in_array($i$skip_key))
                
{
                    
// Auto link make over
                    
if (strpos($value"_") OR strpos($value"-"))
                    
{
                        
//edit 20 feb
                        //$char_to_replace = array ('_', '-');
                        
$char_to_replace $CI->config->item('strip_characters'); 
                        
$value ucwords(strtolower(str_replace($char_to_replace" "$value)));
                    
}
                    
                    
// Unlink last segment (optional)
                    
if ($i == $number_array-&& $CI->config->item('unlink_last_segment'))
                    
{
                        $str 
.= $delimiter.$wrapper_inline[0].ucwords($value).$wrapper_inline[1];
                        break;
                    
}
                    $str 
.= $delimiter.$wrapper_inline[0].anchor($segmentucwords($value)).$wrapper_inline[1];
                
}
            }
            $i
++;
        
 Signature 

burak: Skinny controllers Fat models

Profile
 
 
Posted: 20 February 2010 09:54 AM   [ Ignore ]   [ # 26 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  03-19-2008

@123wesweat
Yeah, I know that 300 will stays unless you stated in $config[‘strip_characters’] something like

$config['strip_characters'= array ('_''-''.html''.php''html''300'); 

But as 300 is not a static value you will have a lot of stripped characters to covers all dynamic numbers.

So, I want to know which one is unique value for your case, is the whole “bansky-tray-300” a unique or just “300” is a unique? Sorry I asked you a lot smile

 Signature 

AutoACL - Access Control Library++ with Very Private Page (VPP) Control
AutoCRUMB - The simplest breadcrumb helper ever
Autocrumb on bitbucket
Integrate CI 2 with Eclipse
———————————————————————————————-
Website: ardinoto.blogspot.com

Profile
 
 
Posted: 20 February 2010 01:55 PM   [ Ignore ]   [ # 27 ]  
Lab Assistant
RankRank
Total Posts:  166
Joined  01-03-2010

haha, you don’t ask a lot but i do.

and i am thinking about your question and i think 300 is the one that’s certainly unique.

As the 300 represents a reference number which is unique.

 Signature 

burak: Skinny controllers Fat models

Profile
 
 
Posted: 20 February 2010 07:40 PM   [ Ignore ]   [ # 28 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  162
Joined  03-19-2008

@123wesweat
If 300 is the only unique, you can modify the url to: domain.com/artwork/street/300/bansky-tray.html or maybe domain.com/artwork/street/bansky-tray/300.html. It’s more easy to read and more common to use in codeigniter.

 Signature 

AutoACL - Access Control Library++ with Very Private Page (VPP) Control
AutoCRUMB - The simplest breadcrumb helper ever
Autocrumb on bitbucket
Integrate CI 2 with Eclipse
———————————————————————————————-
Website: ardinoto.blogspot.com

Profile
 
 
Posted: 21 February 2010 07:39 AM   [ Ignore ]   [ # 29 ]  
Lab Assistant
RankRank
Total Posts:  166
Joined  01-03-2010

hmm, then i need to redo the post slugs, currently already being parsed.

can’t i use a hack like if -[numeric].html don’t show in breadcrumb.

if /numeric do show (as for the pagination)

sorry for all the trouble

 Signature 

burak: Skinny controllers Fat models

Profile
 
 
Posted: 24 February 2010 10:59 AM   [ Ignore ]   [ # 30 ]  
Lab Assistant
RankRank
Total Posts:  166
Joined  01-03-2010

hi ardinotow,

I fix the last number issue i had but now i have created a major one.

I added

require_once './blog/wp-load.php';//WP 

to the index.php as i needed to use WP.

But now the breadcrumb helper “thinks” mydomain.com/blog is the home url??? I do think site_url() doesn’t give the right url

Any suggestions how to fix this??

 Signature 

burak: Skinny controllers Fat models

Profile
 
 
   
3 of 20
3