Submitted by tyler on Thu, 03/15/2012 - 11:49
Alas, I came across a better way to take a bunch of rows from views, group them by a particular field, and provide a count for each.
Here is a basic example for Drupal 6 (probably very similar for Drupal 7).
Basic Settings
Style: HTML List
Fields
Node id (exclude from display)
Node title
Arguments
Node title
Submitted by tyler on Thu, 06/09/2011 - 16:19
Note, since writing this article I learned about Views Arguments 'action to take if argument not present' summary list with counts... it is definitely easier than the approach I documented below. I'll leave what I have done below because I'm not sure the summary list option will handle all cases. Someday I'll update this post to include a tutorial on how to use the aformentioned approach, someday.
Submitted by tyler on Wed, 03/23/2011 - 12:55
To theme the exposed filter form on a view in Drupal:
- Copy sites/all/modules/views/theme/views-exposed-form.tpl.php to sites/all/themes/MY_THEME/views-exposed-form--MY-VIEW-NAME.tpl.php
- Use the views admin UI to rescan the template files
- Basic Settings -> Theme Information -> Rescan Template Files
- Note: it won't show your new template file in the list
- Save your view
If you need more fine tuned methods of modifying the actual form, then use hook_form_alter instead.
Submitted by tyler on Fri, 03/04/2011 - 10:40
Here is how you can programmatically load a Drupal view, then specify a particular page of data to show, then print out the view.
$what_page_to_show = 10;
$view = views_get_view('my_example_view');
$view->pager['current_page'] = $what_page_to_show;
print $view->preview();
Submitted by tyler on Wed, 08/11/2010 - 14:05