I've been banging my head against a wall trying to understand contextual filters for about 6 months now so I thought I'd give up and finally ask. Most recently I read this article on cofiguring contextual filters, which renewed my confusion and frustration on this topic.
Normally in query or procedural languages when you filter something, you specify 2 or 3 things;
- The value to filter (e.g. "blonde")
- The place to look for the values (e.g. the "hair color" column)
- Optionally, the operator to use.
My understanding is that contextual filters only use the "equal to" operator, so I'll leave out 3.
For example, if I wanted to filter a nodes
table on all nodes whose value in the title
column is equal to the contents of the my_title
variable, then in SQL I'd write something like this;
SELECT * FROM nodes WHERE title = @my_title
There's a left hand side (title) and right hand side (my_title). But in the Contextual views section of the view I can only pick the dynamic value to check against (the equivalent of my_title
) but where do I pick what I'm actually filtering on (ie. the title column)?
As far as I can tell this is telling the filter to filter on the ID of the current page. Which is fine, but what am I filtering? What are the left and right hand operators to the filtering operation?