Closed (fixed)
Project:
Views Contextual Range Filter
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
7 Jan 2014 at 22:56 UTC
Updated:
3 Feb 2014 at 03:40 UTC
Jump to comment: Most recent
Comments
Comment #1
bisonbleu commentedBetter examples
Comment #2
rdeboerHi bisonblue,
No it cannot do this at the moment.
It think it would be a useful extension.
Other examples:
yesterday--20 days
-4 weeks--3 months
I may have a crack at it at some point.
Also happy to receive patches.
Best,
Rik
Comment #3
bisonbleu commentedHey Rick,
Thanks for the quick reply.
I was able achieve the required results after patching Views-7.x-3.x-dev with views-357082-153-7.x-3.x-dev.patch.
In short, this requires a contextual filter of type 'Global: Null'. The incoming argument e.g. 2014-03-21 is available and can be used in the improved Configure filter criterion UI. Pretty neat I say!
See issue https://drupal.org/node/357082 for more information.
Cheers
Comment #4
rdeboer@bisonblue
That is some issue thread and some patch that https://drupal.org/files/views-357082-153-7.x-3.x-dev.patch.
What does it do?
Rik
Comment #5
bisonbleu commentedSimply said, it allows you to use an argument as a criterion in a standard filter.
Imagine you want to filter a view of events whose start date is 'greater than' [a-future-date] that you would set dynamically. You can now do it thanks to this patch.
The filter UI will change, allowing you to select your contextual filter as a criterion. Then just append the desired argument to the URL of the view and your good to go!
e.g. http://yourwebsite.com/path_to_your_view/[a-future-date]
Comment #6
rdeboerRe #5: That's cool!
But then when you change the regular filter will it use that as the filter argument or will it the View remain "sticky" on the contextual filter appended to the View?
I guess that is where Views Filter Harmonizer comes in.
Rik
Comment #7
bisonbleu commentedIf you change your filter and uncheck the option 'Use an argument provided by a contextual filter', nothing happens even if the argument remains in the URL. That's because the nature of a 'Global : Null' contextual filter is that it is ignored (i.e. not applied as a filter to the view).
I've heard about 'Views Filter Harmonizer'.
But I have yet to play with it.
Comment #8
rdeboerViews Contextual Range Filter now supports date ranges like the following:
2014-03-21--now
--2014-3-29
now--
last year--next year
last month--tomorrow noon
six months ago -- 2 months ago
Works for node date properties (created, last updated dates) and for Date module fields (default and ISO formats and also Unix timestamps.
Comment #9
rdeboerAll Date module field flavours now support natural language date ranges:
o default Date
o Date ISO format
o Date Unix timestamp format
Also supported as before are node properties (date posted/created, date updated, both of which are timestamps).
Rik