Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I ran into some theming issues with the grid style when my grid only contains one single row: in this case, only the "row-first" class is added to the row. IMO, if there is only one row in the grid, it should have both the "row-first" and "row-last" classes...
Comment | File | Size | Author |
---|---|---|---|
#6 | grid.zip | 771 bytes | pbuonaiuto |
#6 | views-grid.patch | 1.38 KB | pbuonaiuto |
views-grid-last-row.patch | 638 bytes | mr.baileys | |
Comments
Comment #1
mr.baileysfixed typo in title.
Comment #2
dtarc CreditAttribution: dtarc commentedI just had the same issue. The patch fixed it. Thanks!
Comment #3
merlinofchaos CreditAttribution: merlinofchaos commentedCommitted to all branches. Thanks!
Comment #5
pbuonaiuto CreditAttribution: pbuonaiuto commentedThis may be a related issue, so I'll add it here.
I selected a grid style with the number of columns set to '3'. If the view result returns only 2 results, only 2 columns are generated. Imo, a third (empty) cell should be added to fill-out the grid pattern. Note that the current implementation fills-out the grid pattern with empty cells if the last row is not the first row.
Also, a nice feature would be to add a col-first and col-last class to the td's (mirroring the existing row-first/row-last on the tr's).
Comment #6
pbuonaiuto CreditAttribution: pbuonaiuto commentedThe attached patch adds the following:
- If there is only one row, the row will include both row-first and row-last classes,
- added col-first and col-last classes to first and last columns.
- Fixed #5 above: a row with less columns than the specification will output additional (empty) columns to retain a grid pattern.
- Any empty columns are give a col-empty class.
Comment #7
mr.baileys@pbuonaiuto: closed issues are usually not re-opened unless there is an issue with the original fix that was committed. Can you open a separate issue for this?