Adding extra operators in arguments

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Pol's picture

Hello all,

I am currently building a new module that will change the type of operator used in Views queries.

For example, if I add an argument of type: Node:Title, when I add something in the url after the view name, Views will try to find a node which the corresponding Node:Title.
It's doing a equal operator.

My module will help change this behavior and add some other operators like:

  • Is equal to
  • Is not equal to
  • Start with
  • Does not start with
  • Ends with
  • Does not end with
  • Contains
  • Does not contain
  • Contains any words
  • Contains all words
  • String length greater
  • String length greater or equal
  • String length lesser
  • String length lesser or equal
  • String length different
  • String length is between
  • String length is not between

Some people will ask the point of this.

It can be usefull for creating basic and quick searches, but also helping the creation of autocomplete path for fields.

Currently, it works for the type of fields: String and Integers

I'm also planning to add date support.

You can download the module here: http://drupal.org/node/376932 at the bottom.

Comments

Download

Pol's picture

you can download the latest version of the module on this thread: http://drupal.org/node/376932

-Pol-

Only seems to work on Node groups

langrock's picture

I really appreciate the effort that went into this. I could use such an add-on for our website, but it seems that one cannot use this for Content groups, despite the fields being of type text. Maybe this could be generalized? I have a Content: field_publications_authors of type text and would like to use an argument that parses against this field with a CONTAINS operation, similar to what an exposed filter can do.

Thanks

Views Developers

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week