Customising my new theme - Pt3 - moving the Breadcrumb Trail Customising my new theme - Pt3 - moving the Breadcrumb Trail
 

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

Customising my new theme - Pt3 - moving the Breadcrumb Trail

Started by uk_martin, December 09, 2010, 10:35:30 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

uk_martin

Hi

I'm trying to match a phpBB3 theme by altering the curve theme a little (OK, a lot) I've just run into a few problems and I was wonding if anyone could help please? I am currently working on trying to make the overhead menu and header in Coppermine match the one in phpBB3.

Coppermine here - http://www.brummiesfans.com/coppermine/thumbnails.php?album=1
phpBB3 here - http://www.brummiesfans.com/main/viewtopic.php?f=14&t=312

Where I would like some help please is in getting the breadcrumb trail to appear under the menu in the same way as it does in phpBB3

If someone can suggest how the matter can be fixed then I'd be very grateful.


Thanks in advance for any assistance.

Martin

uk_martin

Can someone advise please if this solution (discussed many years ago) will work in the latest version of Coppermine, please?

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

Thanks

Martin

Αndré


uk_martin

I tried, so I guess the answer is "NO"!

Where it says add "{HEADER_BREADCRUMB}" to the template file, I've done that, but where it says add all the code to the theme.php file, if I do that all I get is a blank white page when loading the page up.

Is there any other way of moving the current location of the breadcrumb trail to where I've "pinned" the "{HEADER_BREADCRUMB}" in the header of the page (see http://brummiesfans.com/coppermine/ )

Thanks

Martin

Αndré

What's the actual difference between the breadcrumbs? What do you want to accomplish? Post a screen-shot for visualization.


Quote from: uk_martin on December 10, 2010, 09:08:41 PM
Can someone advise please if this solution (discussed many years ago) will work in the latest version of Coppermine, please?

http://forum.coppermine-gallery.net/index.php/topic,32580.0.html
That's probably not what you want. The custom header will be displayed above your gallery header (with the logo etc.).

uk_martin

My template file is basically a full width "header" div with two <div>'s side by side below it to provide a two-column layout - one with the "menu" word in it (blocks to fill that "column" to follow) and one that contains the gallery content.

The intention is to replicate the look/feel of the layout of the accompanying phpBB forum that this will sit alongside. e.g. - http://www.brummiesfans.com/main/viewforum.php?f=2  As you can see in the forum, the breadcrumb trail is positioned right below the overhead menu. This is where I want the breadcrumb trail in Coppermine too.

It would be nice to be able to include the little arrows that divide the breadcrumb trail up as well, but maybe one step at a time?

I hope that this clarifies the situation

Αndré

So you want to remove the breadcrumb from the 'main' div and add it above the 'columns' div, right? Please attach the current version of your theme.

uk_martin

Quote from: Αndré on December 14, 2010, 02:30:30 PM
So you want to remove the breadcrumb from the 'main' div and add it above the 'columns' div, right? Please attach the current version of your theme.

Yes please, you've got it...The theme files are attached. Hope that these are OK. You'll see that I had to start the template from scratch as I couldn't get the header image and the borders to do what I wanted with the original Curve template. All other files are from Curve though.

By the way, as another little favour, can you have a look to see why the "corners_top" and "corners_bottom" style elements don't seem to work? They are the ones that "should" be putting rounded corners on the overhead menu bar, but aren't. (I took the CSS from the phpBB stylesheet, where it does work, so am a little puzzled by why it doesn't here.)

Thanks again.

Martin

uk_martin

Hi Andre

Have you had any luck? I've been working on other aspects of the theme and making good progress, so my (template.html and style.css) file versions now are a little different. I look forward to hearing from you.

Thanks

Martin

Αndré

Add this to your theme.php file:
function pageheader($section, $meta = '') {
   global $CONFIG, $THEME_DIR;
   global $template_header, $lang_charset, $lang_text_dir;

   $custom_header = cpg_get_custom_include($CONFIG['custom_header_path']);

   $charset = ($CONFIG['charset'] == 'language file') ? $lang_charset : $CONFIG['charset'];

   header('P3P: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"');
   header("Content-Type: text/html; charset=$charset");
   user_save_profile();

   $template_vars = array(
       '{LANG_DIR}' => $lang_text_dir,
       '{TITLE}' => theme_page_title($section),
       '{CHARSET}' => $charset,
       '{META}' => $meta,
       '{GAL_NAME}' => $CONFIG['gallery_name'],
       '{GAL_DESCRIPTION}' => $CONFIG['gallery_description'],
       '{SYS_MENU}' => theme_main_menu('sys_menu'),
       '{SUB_MENU}' => theme_main_menu('sub_menu'),
       '{ADMIN_MENU}' => theme_admin_mode_menu(),
       '{CUSTOM_HEADER}' => $custom_header,
       '{JAVASCRIPT}' => theme_javascript_head(),
       '{MESSAGE_BLOCK}' => theme_display_message_block(),
   );
   
   // Breadcrumb hack - START
   $CONFIG['main_page_layout'] = str_replace(array('/breadcrumb', 'breadcrumb/', 'breadcrumb'), '', $CONFIG['main_page_layout']);
   global $breadcrumb;
   ob_start();
   theme_display_breadcrumb($breadcrumb);
   $template_vars['{HEADER_BREADCRUMB}'] = ob_get_clean();
   // Breadcrumb hack - END
   
   $template_vars = CPGPluginAPI::filter('theme_pageheader_params', $template_vars);
   echo template_eval($template_header, $template_vars);

   // Show various admin messages
   adminmessages();
}



Code updated, see here

uk_martin

Thanks Andre, that is brilliant. I've been able to make it appear almost like in my phpBB style -

http://www.brummiesfans.com/coppermine/index.php?cat=10001

One final thing though, is there any way in which the  ">"  seperator in the breadcrumb trail can be replaced with an image ( "images/icon_sep.gif" ) ?

I did try to introduce the image through CSS, but it did not work well.

Thanks again for your help.

Martin

Αndré

Quote from: uk_martin on December 21, 2010, 11:42:39 PM
is there any way in which the  ">"  seperator in the breadcrumb trail can be replaced with an image ( "images/icon_sep.gif" ) ?
Copy the function theme_breadcrumb to your theme.php file and adjust it accordingly.

uk_martin

Thanks again Andre, you are a star.

For the benefit of anyone else referring to this in the future, there is an additional bit of editing that needs doing here -

in themes.inc.php (where the function is to be found) the original code is:

    // We remove the first ' > '
    $breadcrumb = substr_replace($breadcrumb,'', 0, 3);
    $BREADCRUMB_TEXT = substr_replace($BREADCRUMB_TEXT,'', 0, 3);


The "3" refers to the number of characters pruned from the front of the breadcrumb trail. In my case the code for the link to the image meant that I had to change this to:

    // We remove the first ' > '
    $breadcrumb = substr_replace($breadcrumb,'', 0, 52);
    $BREADCRUMB_TEXT = substr_replace($BREADCRUMB_TEXT,'', 0, 52);


Anyway, thanks again to Andre for the invaluable help.

Martin


Αndré

Please mark your thread as solved according to the board rules :)

uk_martin