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

[eluser]123wesweat[/eluser]
hi ardinotow,

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

I added
Code:
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??
#32

[eluser]ardinotow[/eluser]
@123wesweat
Sorry for late reply. Could you share your fix? I also made a modification so that you can use regular expression to replace any character.

Add these into config/breadcrumb.php
Code:
$config['strip_regexp'] = array ('/[0-9]+.html/');

Find this code
Code:
$value = ucwords(strtolower(str_replace($char_to_replace, " ", $value)));

and add below code after that code
Code:
if ($CI->config->item('strip_regexp'))
{
    foreach($CI->config->item('strip_regexp') as $exp)
    {
        $value = preg_replace($exp, " ", $value);
    }
}
For your next problem, do you use .htaccess for WP blog integration ?
#33

[eluser]ToMix[/eluser]
Many thanks for this Helper its realy good,

i have an issue with replacer

my Articles management page link : ( http://localhost/ci/artic_manage)


inside the config file i added array in this line:

$config['replacer'] = array('artic_manager'=> 'ARTICLES');

what will hapen with this ? the (artic_manager) will replace with (ARTICLES) right?

thats ok with me it did fine..
but the (ARTICLES) now comes with this link:
http://localhost/ci/ARTICLES

insted of: http://localhost/ci/artic_manage

whats wrong with The Replacer ??
#34

[eluser]ardinotow[/eluser]
@ToMix:
Sorry for late answer...You can try new breadcrumb helper version. Please tell me if the problem stil exist.

Regards,
Ardinoto Wahono

Update:
For anyone that have used this helper please do a backup old helper configuration (config/breadcrumb.php) before copy and replace those files!
#35

[eluser]Zeeshan Rasool[/eluser]
Nice work. i was also in search of a helper for generating breadcrums and hopeful this will be a great thing in this matter.
#36

[eluser]ardinotow[/eluser]
Thx Zeeshan
#37

[eluser]StewyMan[/eluser]
I tried this helper and it works great except that the replacer creates a url that doesn't exist on my site.

for example...if the url was: www.usedcars.com/search/display/florida/orlando

and I used the replacer to create the following breadcrumb:

home/usedcars/usa/florida/orlando

Problem: if a user clicks on the USA link or used cars links (the words that replaced the words in the url string) it would not take them to a page that exists. I.e. It would try to find a page at www.usedcars/usa that doesn't exist.

Please help!!
#38

[eluser]ardinotow[/eluser]
@StewyMan
Could you please write your breadcrumb config files here
#39

[eluser]StewyMan[/eluser]
ardinotow...thanks for your help. I was using your last release dated Mar 19th. Here is the config file i am using. Again, it need to use the old link but with the new replacer text as anchor.

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/*
* ------------------------
* Config: set home
* ------------------------
* Default value:
* $config['set_home'] = "Home";
*
* Change initial breadcrumb link
*/
$config['set_home'] = "Home";

/*
* ------------------------
* Config: Delimiter
* ------------------------
* Default value:
* $config['delimiter'] = ' > ';
*/
$config['delimiter'] = ">";

/*
* --------------------------
* Config: Replacer
* --------------------------
* Default value:
* $config['replacer'] = array();
*
* Can either change controller name to the proper name for link label or hide it
* Example:
* 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 produce: Home > Warehouse > Stocks > Search_direct. Noticed that the last link
* is not a common link name. This is where Replacer can be very useful to change link name into anything we like.
* Set the Replacer:
* $replacer = array('search_direct' => 'edit')
* Above line will change the breadcrumb into: Home > Warehouse > Stocks > Edit.
* What if we need to hide Warehouse link from breadcrumb ? Just add the Replacer into:
* $replacer = array('search_direct' => 'edit', 'warehouse' => '')
* This will change breadcrumb into: Home > Stocks > Edit
*/
$config['replacer'] = array('');

/**
* --------------------------
* Config: Exclude
* --------------------------
* Default value:
* $config['exclude'] = array('');
*
* Can hide links that written in array
* Example:
* If we set $config['exclude'] = array('stocks', 'warehouse') then from this URL "http://localhost/arstock/warehouse/stocks/insert"
* we get breadcrumb: Home > Insert
*/
$config['exclude'] = array('in', 'insert');

/**
* ------------------------------------
* Config: Exclude Segment
* ------------------------------------
* Default value:
* $config['exclude_segment'] = array();
*
* Can hide segments
* Example:
* Look at this example URL:
* http://mysite.com/en/search/results
* http://mysite.com/fr/search/results
* If we set $config['exclude'] = array(1) then everything in segment 1 which are 'en' & 'fr' will be hide. We get breadcrumb:
* Home > Search > Results
*/
$config['exclude_segment'] = array();

/**
* --------------------------
* Config: Wrapper
* --------------------------
* Default value:
* $config['use_wrapper'] = FALSE;
* $config['wrapper'] = '<ul>|</ul>';
* $config['wrapper_inline'] = '<li>|</li>';
*
* We set this if we want to make breadcrumb have it's own style.
* it possible to return the breadcrumb in a list (<ul><li></li></ul>) or something else as configure below.
* Set use_wrapper to TRUE to use this feature.
*/
$config['use_wrapper'] = FALSE;
$config['wrapper'] = '<ul id="crumbs" style="list-style-type:none;padding:0px 0px 0px 5px;margin:0;">|</ul>';
$config['wrapper_inline'] = '<li style="list-style-type:none;padding:0px 0px 0px 5px;margin:0;">|</li>';

/**
* ---------------------
* Config: Unlink
* ---------------------
* Default value:
* $config['unlink_last_segment'] = FALSE;
*
* If set to TRUE then the last segment in breadcrumb will not have a link.
*/
$config['unlink_last_segment'] = FALSE;

/**
* ---------------------
* Config: Hide number
* ---------------------
* Default value:
* $config['hide_number'] = TRUE;
*
* If set to TRUE then any number without a word in a segment will be hide.
* Example: http://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
*/
$config['hide_number'] = TRUE;

/**
* -------------------------
* Config: Strip characters
* -------------------------
* Default value:
* $config['strip_characters'] = array ('_', '-', '.html', '.php', '.htm');
*
* All characters in the array will be stripped from breadcrumbs
* Example: http://mysite.com/blog/7-habbits/request.html
* will have breadcrumbs: Home > Blog > 7 Habbits > Request
*/
$config['strip_characters'] = array ('_', '-', '.html', '.php', '.htm');

/**
* ------------------------------------
* Config: Strip by Regular Expression
* ------------------------------------
* Default value:
* $config['strip_regexp'] = array ();
*
* All regular expression in the array will be stripped from breadcrumbs
* Example: http://mysite.com/blog/7-habbits/request-300.html
* set config to: $config['strip_regexp'] = array ('/-[0-9]+.html/');
* then we will have breadcrumbs: Home > Blog > 7 Habbits > Request
*/
$config['strip_regexp'] = array ('/-[0-9]+.html/');

/* End of file breadcrumb.php */
#40

[eluser]ardinotow[/eluser]
@StewyMan,
Maybe you choose the wrong files to paste here because I don't see any replacer value...
Code:
$config['replacer'] = array('');




Theme © iAndrew 2016 - Forum software by © MyBB