Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.4
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Apr 2009 at 17:14 UTC
Updated:
28 Jun 2010 at 23:23 UTC
I would very much like a way to fall back, on an ad-hoc basis, to PHP for the query portion of a view if the standard model is too restrictive, yet still use the views rendering functionality (eg, configurable multiple displays, styles, etc.)
Comments
Comment #1
rprogrammer commentedComment #2
merlinofchaos commentedIt would be nice, but it's surprisingly difficult to do that, because the query generator relies on controlling the aliases.
Comment #3
merlinofchaos commentedProbably your best way to do this would be to create a custom filter that adds whatever filters you need, it can be a giant OR or whatever. That way the rest of the query is still generated by Views.
Comment #4
rprogrammer commentedI tried to make a custom filter, but I got the impression from the docs that you couldn't project a filter onto pre-existing tables, only define filters for your module's own tables.
Comment #5
merlinofchaos commentedYou can add filters to existing tables via hook_views_datal_alter()
Comment #6
merlinofchaos commentedOnly you need to spell the hook correctly, unlike my version above. :P
Comment #7
esmerel commented