views
The Power of Views Argument Handling Code
Submitted by tao on Fri, 2007-09-28 12:26.I had never played with the Argument Handling Code section of the Views UI. But then I had two views that were identical, except for wanted to sort the results differently (most all tiem hits vs most recent hits), and that seemed silly. Kent's great post "Adding Sort via Argument Handler":http://groups.drupal.org/node/4203 got me started. It turned out to be really easy. I set the default sort to "Total Hits", and added this into the field:
if( $args[1] == 'today' ) {
$view->sort[0]['field'] = 'node_counter.daycount';
$view->sort[0]['id'] = 'node_counter.daycount';
}
views_ui reloaded
Submitted by tao on Thu, 2007-03-15 12:00.Stepping up to the plate
Back to our story of Ajax vs the Drupal Form API. After modifying poll.module to work with ahah_forms in a couple of hours, I was feeling cocky, and decided to go for the gold ring: Views. I use views a lot and think it is one of the key drupal modules. And it is the perfect target for Ajax, because creating a View can take over a dozen page refreshes. I went in optimistic. If you read my first post on this topic (http://starbowconsulting.com/blog/tao/dynamically-expanding-ajax-ahah-dr…)
you will remember that the hardest part of the process is getting your dynamic form to work without JavaScript, and views_ui already had that nailed. At the end of my first day’s work I thought I was 90% of the way there. At the end of my second day, I knew I was in trouble.
Update:I have just released version 1.3 of ahah_forms, which includes a significantly simplified version of views_ui.module-example. I realized that since I was not able to accomplish my goal of per-section form processing, I can limit most of my changes to the theming functions. Most of the discussion below is still valid.
Views and Ahah Forms 1.1 released
Submitted by tao on Wed, 2007-03-14 14:08.I am excited to announce the release of the work I have been doing to modify ahah_forms and views_ui to work together. It took weeks longer than I anticipated, and required extending ahah_form.js and tweaking maybe 20% of views_ui, but I am very happy with the result. You can check it out yourself at http://demo.starbowconsulting.com/admin/build/views. The views_ui rewrite is available in the examples directory of ahah_form 1.1 (http://drupal.org/project/ahah_forms)
Recent comments
3 hours 35 min ago
3 hours 38 min ago
3 hours 41 min ago
8 hours 52 min ago
9 hours 48 min ago
11 hours 4 min ago
13 hours 51 min ago
2 days 19 hours ago
3 days 2 hours ago
1 week 4 days ago