I am learning drupal and currently working on Views module.I am learning grouping in views.
I have created two groups using views(set format as Unformatted list).I have modified bit of code in theme.inc
of views module which is located in modules > views > theme
to add class
to it.
So HTML output is like:
I want to add number like 1,2,3 etc
(depending upon the group created) just beside bottom-box-data-
.(Suppose here I have created 2 groups so output should be like bottom-box-data-1 bottom-box-data-2
).
Code of theme.ince
is :
/**
* Display a single views grouping.
*/
function theme_views_view_grouping($vars) {
$view = $vars['view'];
$title = $vars['title'];
$content = $vars['content'];
$output = '<div class="view-grouping bottom-box-data-">';
$output .= '<div class="view-grouping-header">' . $title . '</div>';
$output .= '<div class="view-grouping-content">' . $content . '</div>' ;
$output .= '</div>';
return $output;
}
I know, we need to show some effort then and then some one can help here.But I have no idea from where to start to achieve this.If anyone can help me out, I ll really appreciate it.
Thanks and let me know if more information is required or any one has doubt related to this question.
I came across Drupal SO question, but no one answered to that question yet.
EDITED :
Thanks J. Reynolds for your time and valuable suggestion.
So now I have above function
in my template.php
and I try to achieve my desired result with grouping levels.
var_dump($vars);
$grouping = $vars['grouping_level'];//which is 0 for both grouping.
But grouping level always giving 0
for all group hierarchy.