Advanced search  

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

Pages: [1]   Go Down

Author Topic: How to add category title to album list section?  (Read 945 times)

0 Members and 1 Guest are viewing this topic.

tadeuszd

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
How to add category title to album list section?
« on: February 13, 2024, 11:55:49 am »

Hello!
I'm new on this forum, but I use CPG successfully since 2009. :D

Two weeks ago I started to create completely new theme for my CPG gallery. The main concept is to add more space between tables in the gallery layout. Besause of that I was forced to add additional header bar to the albums section on Category page (red frame in attached screenshot).
I did it by creating new section in $template_album_list template:
Code: [Select]
...
<!-- BEGIN cat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="leftr">{TITLE}</td>
        </tr>
<!-- END cat_row -->
...

... and modifying theme_display_album_list function in theme.php:
Code: [Select]
...
    $cat_row = template_extract_block($template_album_list, 'cat_row');
...
    $columns = $CONFIG['album_list_cols'];
    $column_width = ceil(100 / $columns);
    $thumb_cell_width = $CONFIG['alb_list_thumb_size'] + 2;

    starttable('100%');
// new header bar
$params = array('{TITLE}' => $lang_cat_list['albums'],
'{COLUMNS}' => $columns,
);
echo template_eval($cat_row, $params);

    if ($STATS_IN_ALB_LIST) {
        $params = array('{STATISTICS}' => $statistics,
            '{COLUMNS}' => $columns,
            );
        echo template_eval($stat_row, $params);
    }
...

It works, but I would like to show more information in this bar, something like "Albums in 'My category'". I tried to use $cat parameter, but $cat is only numerical value (category id)  and it doesn't provide any category data.

And this is my question - How can I achieve category title (or other category data, such as image attached to category) from inside theme_display_album_list function?

My current gallery is located at https://galeria.sttandard.org.pl , but my new theme is still "under construction" and available only on localhost.
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 20 queries.