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...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mr.baileys’s picture

Title: "row-last" class missing if grid only one row. » "row-last" class missing if grid has only one row.

fixed typo in title.

dtarc’s picture

I just had the same issue. The patch fixed it. Thanks!

merlinofchaos’s picture

Status: Needs review » Fixed

Committed to all branches. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pbuonaiuto’s picture

This 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).

pbuonaiuto’s picture

FileSize
1.38 KB
771 bytes

The 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.

mr.baileys’s picture

@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?