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

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

[eluser]GrimReaper[/eluser]
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'];
#3

[eluser]ardinotow[/eluser]
[quote author="GrimReaper" date="1260448420"]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'];[/quote]
Thanks for your feedback. i should check it again while i'm still waiting for more feedback from you guys...
#4

[eluser]ardinotow[/eluser]
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:
Code:
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
#5

[eluser]GrimReaper[/eluser]
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:
Quote: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
Quote: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.
#6

[eluser]ardinotow[/eluser]
GrimReaper, glad you like it and feel free to tweak it Smile
#7

[eluser]ardinotow[/eluser]
Feedbacks and comments are very appreciated....
#8

[eluser]CtheB[/eluser]
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:

Code:
$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:

Code:
$delimiter = ' | ';
ar_breadcrumb($exclude, $delimiter);

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

Code:
set_breadcrumb($exclude, $delimeter);

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

Code:
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 askSmile
#9

[eluser]ardinotow[/eluser]
** BREADCRUMB HELPER VERSION 1.0.1 **

New features:
- Easy integration. Just put &lt;?php echo set_breadcrumb(); ?&gt; 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:
Code:
$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:
Code:
$config['replacer'] = array('search_direct' => 'edit', 'warehouse' => '');
OR
Code:
$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:
Code:
$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: &lt;?php echo set_breadcrumb(); ?&gt;. 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.
#10

[eluser]mattpointblank[/eluser]
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)?




Theme © iAndrew 2016 - Forum software by © MyBB