diff --git a/semanticviews.module b/semanticviews.module index 472ab09d0afafe4e28edfb578050f295f90ee5a2..93c7c2c096d03edcc99046f00c4a5b12922fb99e 100644 --- a/semanticviews.module +++ b/semanticviews.module @@ -74,9 +74,17 @@ function template_preprocess_semanticviews_view_unformatted(&$variables) { if ($id == 0 && $variables['options']['row']['first_class']) { $classes[] = $variables['options']['row']['first_class']; } - if (($last_every_nth && ($id + 1) % $last_every_nth == 0) || - (!$last_every_nth && ($id + 1) == count($variables['rows']))) { - $classes[] = $variables['options']['row']['last_class']; + if ($variables['options']['row']['last_class']) { + // The LAST class attribute can be used in two ways. When the "last every + // nth" option is specified, the last attribute is added to the class in + // those intervals. This could be useful for grid designs where the last + // unit in a row needs a zero width margin. + if (($last_every_nth && ($id + 1) % $last_every_nth == 0) || + // Otherwise when last every nth is not set, the LAST class is added + // to the last row in the row set. + (!$last_every_nth && ($id + 1) == count($variables['rows']))) { + $classes[] = $variables['options']['row']['last_class']; + } } // TODO: implement configurable row striping //$classes[] = $id % 2 ? 'even' : 'odd';