Hi, a useful feature would be able to enter arguments to be sent when creating the views component.
This would enable the view to restrict by terms, content type etc.
Possible?
Hi, a useful feature would be able to enter arguments to be sent when creating the views component.
This would enable the view to restrict by terms, content type etc.
Possible?
Comments
Comment #1
dman commentedActually, yeah. Don't see why not.
Could be an additional parameter on the view component config I guess.
I think we've already got enough control of the view object to give it args at build/render time.
A bit of fiddly work to test it all though...
Comment #2
Roulion commentedSubscribe too
this woumld be very useful to filter some huge views (for instance the argument would be a field un the webform node type, so the ability to pass token as argument would be nice (i need to pass 2 arguments)
Comment #3
Roulion commentedA possibility to do this without any patch is adding your arguments to the webform node-type (term reference for example). In the view used to display the form, you can parameter the default argument value in php with a custom code such as
Comment #4
botrisI've managed to do this with an argument / contextual filter.
- Add a taxonomy term filter
- Use php code as default value
Calling your webform like /webformurl?arg=30 (where 30 is your term id) works like a charm.
Comment #5
dman commentedI've done this now in the Webform Views UI. Edit the "webform view" component and next to where you select the View, you can also pass in contextual filter values as arguments that get used by the view.
EG I can set up a webform that only lists items for a certain 'audience' type when the content is tagged appropriately.
The built-in views contextual handlers also work as Boris and Roulion above have found. They have access to the container node info, the path and other things that you may also use as filters. Using that method to grab a value from the incoming URL is probably even MORE useful than just configuring it on the form!
But if you want to define it explicitly, it's now configurable through the UI.
ALSO, the easy way is just to build a couple of displays in views that do your job, but it depends on how many variants you expect to have to re-use.
It's now pushed through to dev but may need more testing if someone wants to document their use-case in a way that can be replicated fully...