Jump to content
Torsten Baldes

[FieldTypeSelector] OR groups

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!

Share this post


Link to post
Share on other sites

I think there is no way around this currently.

  • Sad 1

Share this post


Link to post
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 ?

Share this post


Link to post
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". 

Share this post


Link to post
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

Share this post


Link to post
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 2

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...