What difference between Filters and Arguments? E.g. if I need to show nodes where event_start is located inside specified month, which one should I use?
+3
A:
The main difference is that filters are fixed (unless you expose them, in which case they are explicitly user configurable via forms), whereas arguments are variable, usually taken from the URL (unless you call the view from code, in which case you can set them arbitrarily).
For your example, I think you are restricted to filters, as you can not specify a date range check with arguments (afaik). See this answer to a similar question concerning date ranges.
Henrik Opel
2009-09-04 10:22:29
+1
A:
- Filters are used to restrict the data you are getting. Fx get the nodes that are less than one week old, or which type is page. Filters are static (unless you expose them to the user most common case for that is search).
- Arguments are usually used in the same way, but are very different. They may or may not be present and can come from different sources such as the url, some PHP code ect. Also there can be taken different actions when an argument isn't present.
Which to use would depend on what you want. If you want fx an url of event/%month and then display the events that occured that month, you should go for arguments. But if you want to create a view showing all the events in december, you should use a filter instead.
googletorp
2009-09-04 11:03:17