Views Handler: Custom Sorting of Custom PHP-Script-Based Rendering

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by jeff00seattle on June 18, 2009 at 1:09am

Hi

I have created a custom views_handler_field that has multiple options, as defined within a customized method views_handler_field::options_form(), of rendering a returned value provided by $this->field_alias. The customized rendering of $this->field_alias are various PHP scripts based upon the selected option; e.g. If option A, then render alias value with PHP_A(), etc...

However, I am having difficulty deciphering the forums and documentation on which and how to provide clickable sorting these different renderings.

I am assuming that I should be implementing method click_sort(), but I am not sure if instead I should be implementing a custom views_handler_sort().

I look at examples for both possible solutions, and what I have seen so far is that sorting is based upon SQL queries upon the $this->field_alias. In other works SQL-based formulas applied to $this->query->add_orderby().

I do not want this because my custom renderings are not SQL-based but PHP script generated.

Pointers?

Jeff in Seattle

Comments

Not sure if it's the same

Posted by infojunkie on July 16, 2009 at 6:03am

Not sure if it's the same thing, but the latest dev version of Views Custom Field (http://drupal.org/project/views_customfield) allows sorting the values created in PHP. Take a look at the code to see how I did it.

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /