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

[eluser]ardinotow[/eluser]
[quote author="seongbae" date="1327806484"]Hi ardinotow,

First of all, thank you for a great helper library.

I have one question. I am using your autocrumb for a clothing website. The website has many categories and subcategories. Because the website can change the levels of categories, I made one method called category() in a controller that handles all categories. For example, I have following category structure:

Category 1
- Subcategory 1
-- Sub-subcategory 1
-- Sub-subcategory 2
- Subcategory 2
Category 2

Because displaying any level of categories is done through category() method, when I get to sub-subcategory 1, the breadcrumb displays "Home > Category" and not "Home > Category 1 > Subcategory 1 > Sub-subcategory 1" if you know what I mean.

Is there something I can do in category() method to add or remove to the breadcrumb?

Thank you.

Seong Bae[/quote]

Seong Bae, you can review my answer on Shams Karamat's question above and also refer to add new crumbs on config/breadcrumb.php.

[eluser]ludo31[/eluser]
Hello ; First of all , I would ike to thank you for this work !!

I would like to ask you how I must do in this case :

mu home page is (at this stage I don't show breadcrumb

Quote:http://localhost/MonSite/index.php/site

so when I click on a link Men for example (always at this page ) :

Code:
<a href="&lt;?php echo site_url('client/gestionHomme/'); ?&gt;" title="Homme">Men</a>

the url is
Quote:http://localhost/MonSite/index.php/client/gestionHomme

and breadcrumb is exact :


Quote:Home> Men

and when I would like to know more details about shoes men via by this link in view :

Code:
<a href="http://localhost/MonSite/index.php/client/gestionChaussure/&lt;?php echo $tableau[$j][0];  ?&gt;">

the url is

Code:
http://localhost/MonSite/index.php/client/gestionChaussure/89

and breadcrumb
Quote:Home> Shoes

I think it is normal because in site.php (controller file ) I have
2 functions

Code:
public function gestionHomme(){...}
public function gestionChaussure(){...}

and When we run at gestionHomme function the bread crumb become
Quote:Home> Men
and When we run at gestionChaussure function the bread crumb become
Quote:Home> Shoes

but I would like something like that when it's about shoes details (gestionChaussure)

Code:
Home > Men > Shoes


thanks

[eluser]ludo31[/eluser]
please , I need your help ;
I know how to change : the name of Url

so in my url I have something like that :

Code:
http://localhost/MonSite/index.php/client/getChaussureGenreStyle/1/2/


so I hide client and getChaussureGenreStyle
Code:
$config['exclude'] = array('client','getChaussureGenreStyle');
and I have

Code:
Home > 1 > 2

now the problem is I can't change the name of those number I try to make like this
for example for 1 I would replace by Men and 2 by Baskets
so at the final I have something like that with link

Home > Men >Basket

I try like this for number 1
Code:
$config['replacer'] = array('1' => array('index.php/client/getChaussureGenreStyle/1| Men'));

but it can't change

and for another configuration :

Code:
$config['hide_number'] = FALSE;

$config['hide_number_on_last_segment'] = TRUE;

I hide the last segment because the pagination number at last !!


Did you have an idea please ??

thanks

[eluser]ardinotow[/eluser]
@ludo31, you can't replace number with anything at a moment. But, I'll try to change this behaviour as soon as possible.

[eluser]ludo31[/eluser]
thanks , I solve the problem !! in order to change it and passing it in url
thnaks

[eluser]ardinotow[/eluser]
New Version 12.02.1
What's new ?
1. Number can be replaced
2. Replacer can be overwrites with replacer_embed on every controller

Note: Please see config/breadcrumb.php for more description and examples.

Cheers
Ardinoto Wahono
ardinoto.blogspot.com

[eluser]ludo31[/eluser]

Hello ;
another question :
I try to change the Home by the Icon

Code:
in breadcrumb.php

$config['set_home'] = '<img src = "../../image/supplement/home.png" width = "24" height = "24" alt = "home"/>';

here is a discussion about that
http://ellislab.com/forums/viewthread/137949/P150

And I try the second method but the problem is word Home still appear and image disapear after when we return to the page

Code:
$config['set_home'] = "Home";

/**
* ------------------------
* Config: attribute home
* ------------------------
* Default value:
* $config['attr_home'] = array();
*
* Apply attribute to initial or home link, e.g:
* $config['attr_home'] = array('style' => 'text-decoration:none', 'class' = 'home_breadcrumb');
* Only work if unlink_home is set to FALSE
*/
$config['attr_home'] = array('class' => 'home_breadcrumb');

in css
.home_breadcrumb{
    background-image: url(../image/supplement/home.png);
    background-repeat: no-repeat;
  
}

thanks

[eluser]ardinotow[/eluser]
[quote author="ludo31" date="1333308907"]
Hello ;
another question :
I try to change the Home by the Icon

Code:
in breadcrumb.php

$config['set_home'] = '<img src = "../../image/supplement/home.png" width = "24" height = "24" alt = "home"/>';

here is a discussion about that
http://ellislab.com/forums/viewthread/137949/P150

And I try the second method but the problem is word Home still appear and image disapear after when we return to the page

Code:
$config['set_home'] = "Home";

/**
* ------------------------
* Config: attribute home
* ------------------------
* Default value:
* $config['attr_home'] = array();
*
* Apply attribute to initial or home link, e.g:
* $config['attr_home'] = array('style' => 'text-decoration:none', 'class' = 'home_breadcrumb');
* Only work if unlink_home is set to FALSE
*/
$config['attr_home'] = array('class' => 'home_breadcrumb');

in css
.home_breadcrumb{
    background-image: url(../image/supplement/home.png);
    background-repeat: no-repeat;
  
}

thanks [/quote]

First, you have to make sure that unlink_home is set to FALSE then everything else is depends on what you have wrote on .home_breadcrumb on your css.

[eluser]ChrisMiller[/eluser]
Just a submission, did this hack to work with my site figured I would share. I needed to replace certain uri segments on different controllers so I customized the helper to allow you to add them as needed but still allow backwards compatibility for those that have pre-existing code. All I ask is if you use it just a list my name in the credits as a contributor.


Allow Config Options on the fly
Code:
/* Note addition of $config variable... */
    function set_breadcrumb($delimiter_config = '', $exclude = '', $config= array() )
    {
        $CI =& get_instance();
        $CI->load->helper('url');
        $CI->lang->load('breadcrumb');
        $CI->config->load('breadcrumb');

        // Load configuration
        $ci_version = $CI->config->item('codeigniter_version');
  
        /* --- Start Changes --- */
        $attr_home = ( isset( $config['attr_home'] )
            ? $config['attr_home']
            : $CI->config->item('attr_home') );
  
        $unlink_home = ( isset( $config['unlike_home'] )
            ? $config['unlike_home']
            : $CI->config->item('unlike_home') );

        if (empty($exclude))
        {
            $exclude = $CI->config->item('exclude');
        }
      
        $exclude_segment = ( isset( $config['exclude_segment'] )
            ? array_merge($CI->config->item('exclude_segment'),$config['exclude_segment'])
            : $CI->config->item('exclude_segment') );
  
        $replacer_default = ( isset( $config['replacer'] )
            ? array_merge($CI->config->item('replacer'),$config['replacer'])
            : $CI->config->item('replacer') );
        
        $replacer_embed = ( isset( $config['replacer_embed'] )
            ? array_merge($CI->config->item('replacer_embed'),$config['replacer_embed'])
            : $CI->config->item('replacer_embed') );
  
        $partial_replace = ( isset( $config['partial_replace'] )
            ? array_merge($CI->config->item('partial_replace'),$config['partial_replace'])
     : $CI->config->item('partial_replace') );

        /* --- End Changes --- */

        $uri = rtrim($CI->uri->uri_string(),'/');
        $uri_array_original = explode("/", $uri);

Usage would be...
Code:
&lt;?php echo set_breadcrumb( '', '', array(
    'replacer' =>array (
        'view_by_id'   => 'Viewing Listing',
        'cat'          => 'Apparatus Category'
    )
) ); ?&gt;

Enjoy; Happy Coding

[eluser]ChrisMiller[/eluser]
Another Addition; Requires above code to function...

Allow Custom Segments
Code:
// Check for custom additions
        if ( isset( $config['include_segments'] ) ) {
        
            // Set our variable for usage
            $include_segments = $config['include_segments'];
            
            // Loop our config array
            foreach ( $include_segments AS $k => $v ) {
                $str_link[] = $k;
                $str_name[] = ucwords($v);
            }
        }

Add That code above the following code:
Code:
$str_last = $wrapper[1];
        $str = $str_first;


And the usage would be as follows:
Code:
&lt;?php echo set_breadcrumb( '', '', array(
    'include_segments' =>array (
        '/some/link/'             => 'Most Popular',
        '/some/other/link'        => 'Post Title'
    )
) ); ?&gt;

Code:
/blog/posts/
Would Result in:
Home > Blog > Posts > Most Popular > Post Title




Theme © iAndrew 2016 - Forum software by © MyBB