forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: oekokubus on January 17, 2006, 06:50:46 pm

Title: Cant't get rid of centered text alignment in picture description...
Post by: oekokubus on January 17, 2006, 06:50:46 pm
Have used all my combinatorial skills within the template.html, style.css and theme.php trying to get rid of centered text alignment in the picture description. As BBCode does not work either on that topic, I would appreciate some help how to enforce left aligned text in the picture description box.
Title: Re: Cant't get rid of centered text alignment in picture description...
Post by: Paver on January 17, 2006, 08:10:31 pm
The answer is in theme.php.  If you look in the sample theme's theme.php, you'll see all the variables & functions you can use in your theme.  Only copy the section you want to modify.  In this case, copy the variable $template_display_media from the first comment describing it to the line "EOT;".  To be clear, here it is:
Code: [Select]
// HTML template for intermediate image display
$template_display_media = <<<EOT
        <tr>
                <td align="center" class="display_media" nowrap="nowrap">
                        <table cellspacing="2px" cellpadding="0px" class="imageborder">
                                <tr>
                                        <td align="center">
                                                {IMAGE}

                                        </td>
                                </tr>
                        </table>
                </td></tr>
                <tr><td>
                                                <table width="100%" cellspacing="2px" cellpadding="0px" class="tableb">
                                <tr>
                                        <td align="center">

                                                {ADMIN_MENU}
                                        </td>
                                </tr>
                        </table>





<!-- BEGIN img_desc -->
                        <table cellpadding="0px" cellspacing="0px" class="tableb" width="100%">
<!-- BEGIN title -->
                                <tr>
                                        <td class="tableb"><center><b>
                                                {TITLE}
                                        </b></center></td>
                                </tr>
<!-- END title -->
<!-- BEGIN caption -->
                                <tr>
                                        <td class="tableb"><center>
                                                {CAPTION}
                                        </center></td>
                                </tr>
<!-- END caption -->
                        </table>
<!-- END img_desc -->
                </td>
        </tr>

EOT;
After copying this into your theme.php (wherever you like), go to the section bracketted by <!-- BEGIN caption --> and <!-- END caption -->.  Remove the <center> tag and the picture description will no longer be centered.  Modify the $template_display_media variable however you like.

I found this quickly by going to the web page I wanted to modify (or look up in this case), then "View Source".  I look for the text I want to modify and look for comment tags or something descriptive near it.  Then look in the sample theme.php and find the section to copy.  Always copy from the sample theme.php so you'll have a non-hacked Coppermine.
Title: Re: Cant't get rid of centered text alignment in picture description...
Post by: oekokubus on January 17, 2006, 08:59:42 pm
A big thank you - your instructions just worked like a snap - was close of giving up on Coppermine. Cheers!
Title: Re: Cant't get rid of centered text alignment in picture description...
Post by: Paver on January 17, 2006, 10:12:17 pm
You're welcome.  Remember that in an open-source community, where there's a will, there's a way.