Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Assiging custom CSS classes to tables instead of "maintable"?  (Read 2452 times)

0 Members and 1 Guest are viewing this topic.

thecoalman

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Assiging custom CSS classes to tables instead of "maintable"?
« on: August 19, 2005, 02:47:23 pm »

Is there any way to assign custom css classes to specific tables instead of "maintable"? Specifically I want to assign a class to the breadcrumb table. I'm aware I can edit theme.php and wrap the breadcrub in a custom table but that in turn will still be wrapped by the maintable which won't work for what I'm trying to accomplish.
« Last Edit: August 19, 2005, 05:23:28 pm by Nibbler »
Logged

thecoalman

  • Coppermine newbie
  • Offline Offline
  • Posts: 14
Re: Assiging custom CSS classes to tables instead of "maintable"?
« Reply #1 on: August 19, 2005, 03:59:50 pm »

Nevermind  :) If anyone is interested this is how I did it. Be aware that this works with the standard theme/template files I modified and I'm not sure if has any conflicts with unmodified standard template/theme files.

Open theme.php and find:
Code: [Select]
EOT;
// HTML template for the breadcrumb
$template_breadcrumb = <<<EOT
<!-- BEGIN breadcrumb -->

Replace with:
Code: [Select]
EOT;
// HTML template for the breadcrumb
$template_breadcrumb = <<<EOT
<!-- BEGIN breadcrumb -->
 <table class="yourcustomclass">

---------------------------------------------------------

Find:
Code: [Select]
function theme_display_breadcrumb($breadcrumb, &$cat_data)
{
    /**
     * ** added breadcrumb as a seperate element
     */
    global $template_breadcrumb, $lang_breadcrumb;

    starttable('100%');
    if ($breadcrumb) {
        $template = template_extract_block($template_breadcrumb, 'breadcrumb');
        $params = array('{BREADCRUMB}' => $breadcrumb
            );
        echo template_eval($template, $params);
    }
    endtable();
}

Replace with:
Code: [Select]
function theme_display_breadcrumb($breadcrumb, &$cat_data)
{
    /**
     * ** added breadcrumb as a seperate element
     */
    global $template_breadcrumb, $lang_breadcrumb;


    if ($breadcrumb) {
        $template = template_extract_block($template_breadcrumb, 'breadcrumb');
        $params = array('{BREADCRUMB}' => $breadcrumb
            );
        echo template_eval($template, $params);
    }
    endtable();
}

Pretty simple actually. I tried just wrapping the html template in a table and remove endtable();   but the for whatever reason the closing table tag doesn't appear. The above code seems to work fine. I haven't tried it but it appaers you could do this with any table template. I'm sure this posted before or something similar but I couldn't find it.
« Last Edit: August 19, 2005, 04:07:59 pm by thecoalman »
Logged
Pages: [1]   Go Up
 

Page created in 0.013 seconds with 19 queries.