Skip to content

Commit d0aa1e1

Browse files
committed
Reverse ding groups front page rows to match design better
1 parent 62fa7b4 commit d0aa1e1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

template.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ function ddbasic_preprocess_views_view_responsive_grid(&$vars) {
10021002

10031003
// Loop over the rows to add the correct classes to the row based on the
10041004
// number of columns in the row.
1005-
foreach ($vars['rows'] as $row_number => $row) {
1005+
foreach ($vars['rows'] as $row_number => &$row) {
10061006
switch (count($row)) {
10071007
case 1:
10081008
$vars['row_classes'][$row_number] .= ' group-blocks--one';
@@ -1021,6 +1021,9 @@ function ddbasic_preprocess_views_view_responsive_grid(&$vars) {
10211021
break;
10221022
}
10231023

1024+
// Reverse columns to make the most important at top (make --one at top).
1025+
$row = array_reverse($row);
1026+
10241027
// Add column classes to the current row.
10251028
$column_id = 0;
10261029
foreach ($row as $column_id => $column) {
@@ -1030,5 +1033,9 @@ function ddbasic_preprocess_views_view_responsive_grid(&$vars) {
10301033
// Add last class to last column.
10311034
$vars['rows'][$row_number][$column_id]['classes'] .= ' last';
10321035
}
1036+
1037+
// Reverse rows.
1038+
$vars['rows'] = array_reverse($vars['rows']);
1039+
$vars['row_classes'] = array_reverse($vars['row_classes']);
10331040
}
10341041
}

0 commit comments

Comments
 (0)