How to add category title to album list section? How to add category title to album list section?
 

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

Main Menu

How to add category title to album list section?

Started by tadeuszd, February 13, 2024, 11:55:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tadeuszd

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:
...
<!-- 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:
...
    $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.