coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: armstead on July 01, 2008, 06:19:03 AM

Title: [Solved]: Can someone help me with this layout dilemma?
Post by: armstead on July 01, 2008, 06:19:03 AM
I have a problem that should be simple, but it's driving me up a tree.

I would like to highlight the image, with a minimal header, so that the viewer can see as much of the image without having to scroll down, or get jumped around whenever he changes the page. I also want to require the minimum of clicks-- i.e. being able to go directly into an album from the front page.

I have found a few themes with a small header that do that, such as Oxygen. However, by some quirk, none of the themes with a small header seem to list the album thumbnails on the index page. Instead it is a category name, but you have to go into the cat to see the albums.

So my question is this. Can I somehow have my cake and eat it too? Is there a straightforward way to make a theme like Oxygen show the album thumbnails on the front?

Or, working the otehr way, is there a way to remove or reduce the header on a theme without bunging up the layout.

I have tried a variety of things, such as working with the sample template, or other coding changes. But so far all I've succeeded in doing is breaking the themes.

Does anyone have some suggestions on how to make a simple fic to eitehr reduce a header, OR force a theme to show album thumbs on the index page?

Any answers would be much appreciated.

Title: Re: Can someone help me with this layout dilemma?
Post by: Nibbler on July 01, 2008, 06:27:08 AM
If a theme does not display album thumbs then it's the theme that's overriding the default behaviour. You should be able to find the code that does that in its theme.php.
Title: Re: Can someone help me with this layout dilemma?
Post by: armstead on July 01, 2008, 06:34:18 AM
Thanks for the quick reply.

I've looked for that in the template's codes, but I can't find the command that forces a album thumbnail.

On Oxygen, for example, from my (admittedly newbie) observations, there is a couple of places on the template that seems to want to show the thumbnail, but it doesn't. I went over a comparison with the Classic theme (which it resembles) but I could not find any parallels.

Title: Re: Can someone help me with this layout dilemma?
Post by: Joachim Müller on July 01, 2008, 07:10:45 AM
Reference: announcement thread for the oxygen theme (http://forum.coppermine-gallery.net/index.php/topic,28596.0.html).
Title: Re: Can someone help me with this layout dilemma?
Post by: Nibbler on July 01, 2008, 07:18:45 AM
This is explained in the thread Joachim posted. Just remove the $template_cat_list template and it'll drop back to the default.
Title: Re: Can someone help me with this layout dilemma?
Post by: armstead on July 01, 2008, 07:50:07 AM
Sorry to be a dunderhead, but I tried deleting that as you suggested in that thread and this is what I get:

Parse error: parse error, unexpected $ in /home/content/P/t/n/Ptnson/html/coppermine/themes/oxygen/theme.php on line 171

I tried deleting those lines by commenting out and by actiully deleting them, and I got the same in both.

Here's what I did in the code:

<!-- }


$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
                <td class="tableh1" width="80%" align="left"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{PICTURES}</b></td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
        <tr>
                <td class="catrow_noalb" colspan="3"><table border="0"><tr><td align="left">{CAT_THUMB}</td><td align="left"><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
        </tr>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
        <tr>
                <td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b><!-- {CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
                <td class="catrow" align="center">{ALB_COUNT}</td>
                <td class="catrow" align="center">{PIC_COUNT}</td>
        </tr>

<!-- END catrow -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="3" class="tableh1" align="center"><span class="statlink"><b>{STATISTICS}</b></span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

<!-- EOT;

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

You had also mentioned the possibility of adding an instruction. Might that work better?

Title: Re: Can someone help me with this layout dilemma?
Post by: armstead on July 01, 2008, 07:54:02 AM
PS: That loose line at the beginning of my code snippet was on the same line as the comment out in the code.
Title: Re: Can someone help me with this layout dilemma?
Post by: Joachim Müller on July 01, 2008, 08:07:38 AM
The first <!-- in your above posted code doesn't reside in the original, that's why you get a parse error. Use this code:<?php

define
('THEME_IS_XHTML10_TRANSITIONAL',1);


$template_sys_menu_spacer ="&nbsp; ";


// HTML template for the breadcrumb
$template_breadcrumb = <<<EOT

<!-- BEGIN breadcrumb -->

        <tr>

                <td colspan="3" align="left"><span class="breadcrumb"><b>{BREADCRUMB}</b></span></td>

        </tr>

<!-- END breadcrumb -->

<!-- BEGIN breadcrumb_user_gal -->

        <tr>

                <td colspan="3">

                <table width="100%" cellpadding="0" cellspacing="0" border="0">

                <tr>

                        <td align="left"><span class="breadcrumb"><b>{BREADCRUMB}</b></span></td>

                        <td align="right"><span class="statlink"><b>{STATISTICS}</b></span></td>

                </tr>

                </table>

                </td>

        </tr>

<!-- END breadcrumb_user_gal -->



EOT;

function 
starttable_neta($width '-1'$title ''$title_colspan '1')

{

    global 
$CONFIG;



    if (
$width == '-1'$width $CONFIG['picture_table_width'];

    if (
$width == '100%'$width $CONFIG['main_table_width'];

    echo <<<EOT



<!-- Start standard table -->

<table align="center" width="
$width" cellspacing="0" cellpadding="0">



EOT;

    if (
$title) {

        echo <<<EOT

        <tr>

                <td class="tableh1" colspan="
$title_colspan">$title</td>

        </tr>



EOT;

    }}

function 
theme_display_breadcrumb($breadcrumb, &$cat_data)

{

    
/**

     * ** added breadcrumb as a seperate element

     */

    
global $template_breadcrumb$lang_breadcrumb;



    
starttable_neta('100%');

    if (
$breadcrumb) {

        
$template template_extract_block($template_breadcrumb'breadcrumb');

        
$params = array('{BREADCRUMB}' => $breadcrumb

            
);

        echo 
template_eval($template$params);

    }

        
endtable();

}



?>


Title: Re: Can someone help me with this layout dilemma?
Post by: armstead on July 01, 2008, 08:25:51 AM
That did it. Worked like a charm (though I'm not sure I understand why).

Many thanks.

One other quick question....If I do the same code into otehr themes, will it have the same effect, or does it have to be tailored to the specific theme?