I'm wondering what the difference would be between this module and the Viewfield module. The Viewfield module can create a field that references a view and then displays it. It seems to work with the Paragraphs module. Does Views Filter Object have additional features?

Comments

murrayw’s picture

Assigned: Unassigned » radimklaska

I have not used ViewField so cannot comment from experience, however, I think I can provide a few comments based of the module description:

Author chooses a view and display from a list.
View arguments are supplied through tokens.

The main difference here is how arguments are passed to the view. In the case of ViewField, arguments are passed as "tokens". See here for a description:
https://www.drupal.org/node/1210142

It would appear that the token is receiving its context from the current node... or whatever tokens provides you.

Views Filter Object allows the site builder to define the fields (on a Paragraph) which provide options to drive the arguments of a view. This is achieved by an array which maps from the entity to the view arguments. There are a few other goodies in there such as being able to define the display, the offset and count etc.

Upon reflection I can see where you are going with this. I think that you are suggesting that you could add a Viewfield to an entity (Paragraph or Node or whatever) and then add a bunch of fields to the same entity to provide the configuration. The Viewfield could then use tokens into the same entity to pull out the config. That is a pretty simple approach and one which could work well. If it did work, and I think that it might, it could well be a simpler approach than Views Filter Object as there would be no need for the mapping array - this would be wired together with tokens.

I can see that a lot of the work we did with the mapping array was to handle drilling down into field array structures, which come to think of it is pretty much what token is used for.

I think that your suggestion has merit and I'll pass this over to Radim to see what he thinks

kopeboy’s picture

What do you think Radim? :)

Should I go on and use Viewfield module instead of seeing what this does?