Jump to content

[FieldTypeSelector] OR groups


Torsten Baldes
 Share

Recommended Posts

Hi, I'm using the core module FieldTypeSelector (like Lister) to be able to create custom lists of pages on my pages. e.g. show me pages with template=foo, somevalue=bar and someothervalue=foobar.

Is there a way to use OR groups (https://processwire.com/docs/selectors/#or-groups) with FieldTypeSelector? This way I could build a list of pages which have somevalue=bar OR someothervalue=foobar
As a selector this would look like this: template=foo, (somevalue=bar), (someothervalue=foobar)

Is this possible? I know I could insert this as a _custom selector, but this would kind of defeat the purpose of FieldTypeSelector.

Thanks!

Link to comment
Share on other sites

1 hour ago, Torsten Baldes said:

I know I could insert this as a _custom selector, but this would kind of defeat the purpose of FieldTypeSelector.

I'm not sure I understand. Are your client's editors using this to make selections? Or you (= the developer)? If the latter, why not use custom selector with something like title%=axa|client_name%=sbb ?

Link to comment
Share on other sites

15 hours ago, dragan said:

I'm not sure I understand. Are your client's editors using this to make selections? Or you (= the developer)? If the latter, why not use custom selector with something like title%=axa|client_name%=sbb ?

Most of the time other users/editors use this Field to "generate" a selection of posts/pages which are applicable for the topic of the current post. Something like "If you liked this post, then these posts could also be interesting to you". 

Link to comment
Share on other sites

@Torsten Baldes, there has been an @todo note about adding OR-group support to InputfieldSelector since 2016.

Quote

@todo add support for "custom: OR-group" option (https://processwire.com/talk/topic/13116-or-selecters-for-different-fields/)

Seeing as Ryan has been doing some work on InputfieldSelector recently it might be timely to open a request for this in the requests repo to bring it back to his attention. ?

  • Like 3
Link to comment
Share on other sites

Ah, the or groups selector post ?

We really needed this a few years ago. Unfortunately Ryan did not manage to implement this. No hard feelings though since this is not an easy task. But I do believe it should be developed since this is a big USP over other rule builders. ProcessWire can really shine with these kind of data structures. 

I eventually created a Process module which created pages has a sort of multiplier field of InputfieldSelector. The client could scope the main selector and add groups by adding more selectors.

- Main Selector template=foo (InputfieldSelector)
|-- Selector 1 (OR) somevalue=bar (repeatable field with InputfieldSelector)
|-- Selector 2 (OR) someothervalue=foobar (etc)

This fields eventually resolved in: "template=foo, (somevalue=bar), (someothervalue=foobar)". I created another Process Module we rendered these selectors in a list and created urls (using the great ProcessPageListerUrls). This might feel like overkill, but the client wanted to query complex selectors.

  • Like 3
Link to comment
Share on other sites

Moderator note: this thread is about a core feature, so I'm moving it to the General Support area of the forum. Modules/Plugins area is intended for dedicated support threads of third party modules. Thanks!

  • Like 1
Link to comment
Share on other sites

On 7/3/2019 at 2:09 PM, Robin S said:

@Torsten Baldes, there has been an @todo note about adding OR-group support to InputfieldSelector since 2016.

Seeing as Ryan has been doing some work on InputfieldSelector recently it might be timely to open a request for this in the requests repo to bring it back to his attention. ?

Thanks! I just posted a feature request.

  • Like 1
Link to comment
Share on other sites

  • 1 year later...
On 7/3/2019 at 2:09 PM, Robin S said:

@Torsten Baldes, there has been an @todo note about adding OR-group support to InputfieldSelector since 2016.

https://processwire.com/talk/topic/13116-or-selecters-for-different-fields/

Unfortunately the thread is not accessible for everybody. Why?

Quote

You do not have permission to view this content.

 

On 7/15/2019 at 8:57 AM, Torsten Baldes said:

Thanks! I just posted a feature request.

 ... which could be found here: https://github.com/processwire/processwire-requests/issues/317
For everyone who is interested in this function. Please vote or add a comment.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...