By alexbond on
Can I somehow use operator on views argument?
Basically, I need to filter nodes with the date created older than the currently loaded node and I want to use views argument for that... If I specify just node's date created, it uses the exact match which is not what I want. Is there any other way of doing that?
Any advice is very welcome. Thank you!
Comments
Context Module, Perhaps?
I JUST, literally Just read about this one. Take a look here:
http://drupal.org/project/context
A video presentation about it here:
http://mustardseedmedia.com/podcast/episode38
See if you can get what you want there. It may be possible within Views, but it just sounded like something that might be in the Context module as well, and it sounds like a very powerful tool to me.
Not exactly what I need...
Checked that video and the module... Doesn't help.
I'd really appreciate if anybosy can give any hint on where to dig in order to find a solution for that. Maybe I should create a custom filter instead?
Please help!!!
On Dates in Views Filters....
You said:
You did notice that you can set the granularity in date filters, right? When I set date filters, I can tell it to look "by the minute" which is the default on up to by day or maybe further out. If you change it from "by minute" to "by day" or maybe "by hour" would be good enough, perhaps that's all you need?
filter vs argument
I need a filtering logic related to date of the currently loaded node (which I can do only with argument) and not the specific date or current date (what filters do).
The only way I can do it, s to override the module logic and add a functionality myself.
Unbelievable
I would have expected something like this to already be out there. Well, if it isn't, this'd be a good time to recommend it, I'm sure! Perhaps you can make a product recommendation/request on the Views module issues list. And if you know how to code, perhaps you could help some in making that happen...
You can use date intervals as
You can use date intervals as arguments with a format like 2010-08-21--2010-08-28.
if necessary, you can set a reasonnably far away max date within the set range.
Thank you. This worked in my
Thank you. This worked in my case.
I used php date functions to get current date.
Cheers,
TechNikh
In 30 seconds set up Automated Visual testing of your website. Zero coding. https://drupal.org/project/drulenium
Ever dreamed of styling your view, We have a solution for you. https://drupal.org/project/views_stylizer
It looks like this is going to be included in Views 3
http://drupal.org/node/357082
herd45
A custom handler will do this
This is very easy to include in a custom handler. Basically, views_handler_argument_numeric (and other argument handlers) do not provide any options for how the $operator should act outside of = or !=. Here is an example which allows you to filter against a node's published date by >=, <=, or = the argument provided.
example/example.module:
example/views/example.views.inc:
Finally, in example/views/example_handler_argument_numeric.inc: