forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: thecoalman on August 19, 2005, 02:47:23 pm

Title: Assiging custom CSS classes to tables instead of "maintable"?
Post by: thecoalman 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.
Title: Re: Assiging custom CSS classes to tables instead of "maintable"?
Post by: thecoalman 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.