How I can change the separator breadcrumb a picture? How I can change the separator breadcrumb a picture?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

How I can change the separator breadcrumb a picture?

Started by cherokee, February 22, 2014, 10:57:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cherokee

How I can change the separator breadcrumb a picture?
In includes / function.inc found in this code, but I can not replace the symbol with a picture.
//Add Link for album if aid is set
    if (isset($CURRENT_ALBUM_DATA['aid'])) {
        $breadcrumb_links[$cat_order] = "<a href=\"thumbnails.php?album=".$CURRENT_ALBUM_DATA['aid']."\">".$CURRENT_ALBUM_DATA['title']."</a>";
        $BREADCRUMB_TEXTS[$cat_order] = $CURRENT_ALBUM_DATA['title'];
    }

Site tests:http://www.rutasytravesias.com/galeria
Thanks
Regards

allvip

The code for breadcumb is in theme.php not in include (all coppermine function are in themes/sample/theme.php.If you want to edit something find the right function in the sample theme,paste it in your theme and edit it)

This is the function theme_breadcrumb for breadcumb:


/******************************************************************************
** Section <<<theme_breadcrumb>>> - START
******************************************************************************/
// Function for building the breadcrumb
// Inputs:  $breadcrumb_links, $BREADCRUMB_TEXTS
// Outputs: $breadcrumb, $BREADCRUMB_TEXT
function theme_breadcrumb($breadcrumb_links, $BREADCRUMB_TEXTS, &$breadcrumb, &$BREADCRUMB_TEXT)
{
    $breadcrumb = '';
    $BREADCRUMB_TEXT = '';
    foreach ($breadcrumb_links as $breadcrumb_link) {
        $breadcrumb .= ' > ' . $breadcrumb_link;
    }
    foreach ($BREADCRUMB_TEXTS as $BREADCRUMB_TEXT_elt) {
        $BREADCRUMB_TEXT .= ' > ' . $BREADCRUMB_TEXT_elt;
    }
    // We remove the first ' > '
    $breadcrumb = substr_replace($breadcrumb,'', 0, 3);
    $BREADCRUMB_TEXT = substr_replace($BREADCRUMB_TEXT,'', 0, 3);
}
/******************************************************************************
** Section <<<theme_breadcrumb>>> - END
******************************************************************************/



or this code for function breadcumb made by Andre that changes the breadcumb structure:

http://forum.coppermine-gallery.net/index.php/topic,76955.0.html

allvip

How to edit function breadcumb:

the line $breadcrumb .= ' > ' . $breadcrumb_link; has the > that shows in the breadcumb

$BREADCRUMB_TEXT .= ' > ' . $BREADCRUMB_TEXT_elt; has the > that shows up in the browser tab

$breadcrumb = substr_replace($breadcrumb,'', 0, 3); is to hide > that shows before the word Home (3 is the number of characters to hide. ' > ' has 3 characters.)


I REMOVED ALL MY POSTS with code because Andre posted the right way to do this.
I only let this post for users that need to understand the code.


cherokee

hello.
Thanks for your interest. I will make the changes.
regards

cherokee

Sorry.
We were writing about the same time.
I'll try the change you propose.
Thank you again.
Sorry for my english

ΑndrĂ©

I suggest to store the image's HTML code in a variable like
$separator = '<img src="themes/panzajoteros/images/navbit-arrow-right.png"/>';
and then use
strlen($separator)
to let PHP count the number of characters for you.

Note that allvip's code still contains some custom modifications, so it's maybe not exactly what you're looking for. That's why I suggest to add this code to your theme's theme.php file:
/******************************************************************************
** Section <<<theme_breadcrumb>>> - START
******************************************************************************/
// Function for building the breadcrumb
// Inputs:  $breadcrumb_links, $BREADCRUMB_TEXTS
// Outputs: $breadcrumb, $BREADCRUMB_TEXT
function theme_breadcrumb($breadcrumb_links, $BREADCRUMB_TEXTS, &$breadcrumb, &$BREADCRUMB_TEXT)
{
    $breadcrumb = '';
    $BREADCRUMB_TEXT = '';
    $separator = '<img src="themes/panzajoteros/images/navbit-arrow-right.png" />';
    foreach ($breadcrumb_links as $breadcrumb_link) {
        $breadcrumb .= $separator . $breadcrumb_link;
    }
    foreach ($BREADCRUMB_TEXTS as $BREADCRUMB_TEXT_elt) {
        $BREADCRUMB_TEXT .= $separator . $BREADCRUMB_TEXT_elt;
    }
    // We remove the first $separator
    $breadcrumb = substr_replace($breadcrumb,'', 0, strlen($separator));
    $BREADCRUMB_TEXT = substr_replace($BREADCRUMB_TEXT,'', 0, strlen($separator));
}
/******************************************************************************
** Section <<<theme_breadcrumb>>> - END
******************************************************************************/