contao / core

Contao 3 → see contao/contao for Contao 4
GNU Lesser General Public License v3.0
490 stars 214 forks source link

Gallery - CSS classes in rows are wrong #2803

Closed ghost closed 12 years ago

ghost commented 12 years ago

Hello Leo!

I do not know, if this is a feature or a bug.

If number of images per page is limited and paging is needed, the last row of the first page does not have the CSS class "row_last". Only in the last row of the last page this class is set. The same is to "row_first" on second and following pages. This is only set on first page first row.

For CSS formatting, I think, it looks better, to have the possibility, to set properties to first and last row on each page not only on first or last page.

Sincerely Oliver

--- Originally created by ofriedrich on January 15th, 2011, at 08:08pm (ID 2803)

ghost commented 12 years ago

My mistake: row_first is set correctly! It only happens to row_last.

If you have only one row, both classes should be set. This should be the same to col_first and col_last, if there is only one column.

system/modules/frontend/ContentGallery.php near line 228 replace

            if (($i + $this->perRow) >= count($images))
            {
                $class_tr = ' row_last';
            }

with

            if (($i + $this->perRow) >= $limit)
            {
                $class_tr .= ' row_last';
            }

near line 245 replace

                if ($j == ($this->perRow - 1))
                {
                    $class_td = ' col_last';
                }

with

                if ($j == ($this->perRow - 1))
                {
                    $class_td .= ' col_last';
                }

Detected in Contao version 2.9.3

--- Originally created by ofriedrich on January 16th, 2011, at 06:52am

leofeyer commented 12 years ago

[[WikiIncompleteDe|Unvollständiges Ticket]]

--- Originally created on January 21st, 2011, at 11:00pm

leofeyer commented 12 years ago

Fixed in a79d757afe95f144f61769d7ec0496d9.

--- Originally created on February 24th, 2011, at 03:19pm

leofeyer commented 12 years ago

--- Originally completed on February 24th, 2011, at 03:19pm