EllisLab text mark
Advanced Search
1 of 15
1
   
Autocrumb - Lightweight Breadcrumb Helper (ver.12.05.1)
Posted: 09 December 2009 06:58 PM   [ Ignore ]
Avatar
Joined: 2008-03-19
163 posts

Please let me introduce the simplest ever breadcrumb helper. It just take 5 minutes to make the helper run. Grab it, install, and see the breadcrumb work. Hope this litte script can help you a lot…

** Version History **
Version 12.05.1 - Date released 17-May-12 - http://ellislab.com/forums/viewreply/1003857/
Version 12.02.1 - Date released 1-April-12 - http://ellislab.com/forums/viewreply/992246/
Version 12.01.1 - Date released 5-Jan-12 - http://ellislab.com/forums/viewreply/967139/
Version 6.11.1 - Date released 10-Jun-11 - http://ellislab.com/forums/viewreply/902953/
Version 3.11.1 - Date released 5-Mar-11 - http://ellislab.com/forums/viewreply/864920/
Version 9.10.1 - Date released 18-Sept-10 - http://ellislab.com/forums/viewreply/801599/
Version 5.10.1 bug fixed - Date released 19-Aug-10 - http://ellislab.com/forums/viewreply/789391/
Version 5.10.1 - Date released 4-May-10 - http://bitbucket.org/ardinotow/autocrumb/downloads - Related article http://ellislab.com/forums/viewreply/742825/
Version 4.10.1 - Date released 4-Apr-10 - http://ellislab.com/forums/viewreply/734004/
Version 3.1.0 - Date released 19-Mar-10 - http://ellislab.com/forums/viewreply/727462/
Version 2.0.0 - Date released 05-Feb-10 - http://ellislab.com/forums/viewreply/708069/
Version 1.0.4 - Date released 13-Jan-10 - http://ellislab.com/forums/viewreply/695221/
Version 1.0.3 - Date released 12-Jan-10 - http://ellislab.com/forums/viewreply/694475/
Version 1.0.2 - Date released 14-Dec-09 - http://ellislab.com/forums/viewreply/682597/
Version 1.0.1 - Date released 13-Dec-09 - http://ellislab.com/forums/viewreply/682034/
Version 1.0.0 - Date released 10-Dec-09 - Link has been removed.

** How-To Install **
1. Put breadcrumb_helper.php to application/helpers.
2. Put breadcrumb.php to application/config.
3. Load the helper either in your controller or in autoload config.
  In your controller   : $this->load->helper(‘breadcrumb’) OR
  In autoload : $autoload[‘helper’] = array(‘breadcrumb’)
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.
5. Change the configuration as you need.

** NEWS **
Now autocrumb is available on bitbucket! Version 4.10.1 and later can be downloaded via bitbucket. Here is the link: http://bitbucket.org/ardinotow/autocrumb/

** MY PAYPAL LINK **

Paypal Donations

 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

 
Posted: 10 December 2009 03:33 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2009-12-07
9 posts

Hi ardinotow,

Good job! although I still get an error when I fill $replacer variable and I use .htaccess a lot to change the original CI URL, so maybe it’s better if we change :
$uri = $CI->uri->uri_string();
to
$uri = $_SERVER[‘REQUEST_URI’];

 Signature 

Sorry for my grammar and spelling error…. English is not my native language

 
Posted: 10 December 2009 06:45 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts
GrimReaper - 10 December 2009 08:33 AM

Hi ardinotow,

Good job! although I still get an error when I fill $replacer variable and I use .htaccess a lot to change the original CI URL, so maybe it’s better if we change :
$uri = $CI->uri->uri_string();
to
$uri = $_SERVER[‘REQUEST_URI’];

Thanks for your feedback. i should check it again while i’m still waiting for more feedback from you guys…

 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

 
Posted: 10 December 2009 01:32 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts

By default, URLs in CodeIgniter are designed to be search-engine and human friendly. Rather than using the standard “query string” approach to URLs that is synonymous with dynamic systems, CodeIgniter uses a segment-based approach:

example.com/news/article/my_article 

So, if you follow standard CI URLs and not using heavy mod_rewrite then teoritically you have no difficulties in using my breadcrumb helper.
Any thought guys?...Let me know

Cheers,
Ardinoto W

 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

 
Posted: 11 December 2009 08:24 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2009-12-07
9 posts

I’m aware about how difficult to create a breadcrumb link from non-standard CI Url, but mod_rewrite can change my URL to become more meaningful and get more credits in SEO.

assuming my website article was multilanguage, english and spanish:

example.com/history/en/23 (english)
and
example.com/history/sp/23 (spanish)

by using php to create meaningful link and mod_rewrite, I can make my URL like

example.com/history/green-apple-23
and
example.com/historia/manzana-verde-23

Once again, good job for your helper! I will try to tweak it later and post it here if I succeed.

 Signature 

Sorry for my grammar and spelling error…. English is not my native language

 
Posted: 11 December 2009 11:01 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts

GrimReaper, glad you like it and feel free to tweak it 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

 
Posted: 12 December 2009 07:08 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts

Feedbacks and comments are very appreciated….

 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

 
Posted: 12 December 2009 08:19 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2008-10-18
76 posts

Hi, I will give you some feedback.

It’s real simple, and really easy. It only needs some more options to set.

For instance i have url’s like this:

http://mysite.com/en/search/results
http://mysite.com/fr/search/results
http://mysite.com/de/search/results
http://mysite.com/es/search/results
http://mysite.com/it/search/results

My breadcrumb will be like this:

Home > En > Search > Results
Home > Fr > Search > Results
Home > De > Search > Results
Home > Es > Search > Results
Home > It > Search > Results

So i do have 2 recommendations:

1. Make it possible to give an array with segment and string to exclude from breadcrumb.

so for instance:

$exclude = array('1' => 'en''1' => 'fr''1' => 'de''1' => 'es''1' => 'it')

ar_breadcrumb($exclude); 

2.  Make it possible to set the delimiter in a parameter like this:

$delimiter ' | ';
ar_breadcrumb($exclude$delimiter); 

3. Change the name of the helper to something more meaningfull, like all the other codeigniter helpers like this:

set_breadcrumb($exclude$delimeter); 

4. Start the file with another line like all codeigniter helpers like this:

if ( ! function_exists('set_breadcrumb'))
{
function set_breadcrumb(($exclude = array(), $delimeter ' > ')

5. Make it possible to return the breadcrumb in a list (<ul><li></li></ul>) or something else, whatever is required.

Good luck, if you need some more help please ask:)

 
Posted: 12 December 2009 09:42 PM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts

** BREADCRUMB HELPER VERSION 1.0.1 **

New features:
- Easy integration. Just put <?php echo set_breadcrumb(); ?> in view files.
- Can use any delimiter.
- Easy to replace any unproper link name.
- Easy to hide any link by it’s name or number segment (new).
- Return the breadcrumb in a list (<ul><li></li></ul>) or something else (new).


What this helper can do for you:
Suppose we have module name: warehouse, controller name: stocks and method name: search_direct
So, if we want to call search_direct, we should type :
“http://localhost/arstock/warehouse/stocks/search_direct” in url address. From this URL,
Breadcrumb helper will automagically produce: Home > Warehouse > Stocks > Search_direct.

Oops, I think the last link is not a common link name. No problem, this is where Replacer can be very useful to change link name into anything we like.
Set the Replacer in breadcrumb.php located on config folder into:

$config['replacer'= array('search_direct' => 'edit'); 

That configuration will change the breadcrumb into: Home > Warehouse > Stocks > Edit.


What if we need to hide Warehouse link from breadcrumb ? Just set the Replacer OR Exclude into:

$config['replacer'= array('search_direct' => 'edit''warehouse' => ''); 

OR

$config['exclude'= array('warehouse'); 

Both will change breadcrumb into: Home > Stocks > Edit


Hey, I need to hide all link in second segment of my URL what should I do? Instead of using Replacer or Exclude, you may use other configuration which is Exclude Segment. For example:

$config['exclude_segment'= array(2); 


More configuration information can be found on config/breadcrumb.php that I believe easy to understand and configure.


Installation:
1. Put breadcrumb_helper.php to application/helpers.
2. Put breadcrumb.php to application/config.
3. Load the helper either in your controller or in autoload config.
  In your controller   : $this->load->helper(‘breadcrumb’) OR
  In autoload : $autoload[‘helper’] = array(‘breadcrumb’)
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.
5. Change the configuration as you need.


As usually, feedback, comment, or questions are welcome.

Enjoy and cheers,
Ardinoto
———————————————————————————————————————————-
NB: CtheB thanks for your feedback. It’s very inspiring me to make an update to version 1.0.1 that mostly covers your request 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

 
Posted: 14 December 2009 07:42 AM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-11
175 posts

Not bad. Maybe add some ability to make strings look a little nicer automatically? Eg convert ‘search_direct’ to ‘Search Direct’ (without adding it into the config manually)?

 
Posted: 14 December 2009 02:35 PM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts
mattpointblank - 14 December 2009 12:42 PM

Not bad. Maybe add some ability to make strings look a little nicer automatically? Eg convert ‘search_direct’ to ‘Search Direct’ (without adding it into the config manually)?

Thanks, I’ve made new updates

** Breadcrumb Helper 1.0.2 **

New Features:
1. Auto link beauty. E.g. if we have ‘search_direct’ as a segment in URL then it automatically convert to ‘Search Direct’ without using $config[‘replacer’].
2. Can unlink the last segment of breadcrumb. If $config[‘unlink_last_segment’] set to TRUE then the last segment in breadcrumb will not have a link.

Enjoy,
Ardinoto

-Feedback, comments, and feature request are welcome-

 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

 
Posted: 14 December 2009 03:28 PM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-11
175 posts

Fast work! Thanks.

 
Posted: 14 December 2009 06:34 PM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts

You’re welcome 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

 
Posted: 15 December 2009 11:47 PM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Joined: 2008-04-12
3 posts

Awesome.

 
Posted: 16 December 2009 09:40 PM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-19
163 posts
Tooker - 16 December 2009 04:47 AM

Awesome.

Glad you like it. Still need more feedback guys…

 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

 
Posted: 06 January 2010 05:35 AM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2008-03-14
55 posts

Thank’s for this helper !

Nevertheless, is it possible to replace the default string ‘Home’ without hacking the helper file ?

I tried this but it doesn’t work :

$config['replacer'= array(

    
'Home' => 'Accueil'

); 

Thanks wink

EDIT : Hum can’t make it works as expected, the line $uri_array = array_replace($uri_array, $replacement); just crash the script : /

 Signature 

ACICRUD Library - CKEditor Helper
@NukiumSolutions - My Blog (fr / en)

 
1 of 15
1