Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Wrap template_cat_list in div  (Read 5267 times)

0 Members and 1 Guest are viewing this topic.

biellebrunner

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Wrap template_cat_list in div
« on: August 22, 2020, 08:03:50 am »

I'm trying to wrap the category list in a div, but I can't seem to make it work.

In the main page, it looks just fine, but when I go in a category with child categories, the category list there doesn't have the closing div, so the rest of the layout is all messed up.

This is my template_cat_list:

Code: [Select]
// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
<div class="listagem">
        <div class="row">
                <div class="titlerow principal">{CATEGORY}</div>
                <div class="titlerow estreito">{ALBUMS}</div>
                <div class="titlerow estreito">{PICTURES}</div>
        </div>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
        <div class="catrow full">{CAT_TITLE}{CAT_DESC}</div>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
        <div class="row">
                <div class="catrow principal">{CAT_TITLE}</div>
                <div class="catrow estreito">{ALB_COUNT}</div>
                <div class="catrow estreito">{PIC_COUNT}</div>
        </div>
<!-- END catrow -->
<!-- BEGIN footer -->
        </div><div class="estatistica">{STATISTICS}</div>
<!-- END footer -->
<!-- BEGIN spacer -->
<!-- END spacer -->

EOT;

I've tried moving the div before statistics to outside the tags (it doesn't show up), to other tags (either doesn't show up or closes the catlist before all rows are displayed). I've tried using 'print' and 'echo' at the end, before EOT;, but all to no avail.

Can anyone help, please?
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 2026
Re: Wrap template_cat_list in div
« Reply #1 on: August 22, 2020, 02:12:33 pm »

Unless you've changed code elsewhere, you're trying to stuff a bunch of divs in a table without any table rows or columns. You might want to put a <tr><td> to begin the header and a </td></tr> at the end of the footer.

Code: [Select]
<!-- BEGIN header -->
<tr><td><div class="listagem">

Code: [Select]
<!-- BEGIN footer -->
<div class="estatistica">{STATISTICS}</div>
</div></td></tr>
Logged

biellebrunner

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 46
Re: Wrap template_cat_list in div
« Reply #2 on: August 22, 2020, 05:28:14 pm »

I've made changes so I could get a totally responsive design with just the elements I want.
My starttable calls a div.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.