Jump to content

Inputfield Dependencies OR operators


a-ok
 Share

Recommended Posts

Hi folks,

Firstly... what an incredible CMS. Just been a breath of fresh air and really finding it so powerful. So thanks!

Just a quick question. I read on the Inputfield Dependencies docs that OR selectors | aren't supported here yet. This is fine... but is there an alternative or another way to do the example below?

I have a Pagefield set up for a 'Members' section, to choose whether the member is a Chair or Vice Chair when adding each children page to this section. If they select 'Chair' OR 'Vice Chair' from the dropdown, I would like a specific field (email address) to be shown. I have done some input dependencies on other fields/templates (show a closing_date field if the news type is 'Job') etc. but have only ever had one dependency to declare. Now I have two, which I know you can separate with a comma, but essentially, it needs to be if either 'Chair' or 'Vice Chair' is selected from the Pagefield dropdown.

chair_vice=1062|chair_vice=1063
chair_vice=1062|1063

You see what I mean? Any clues/tips? Or would I need to create two fields here? An email field for Chair and an email field for Vice?

Thanks in advance,

R

Link to comment
Share on other sites

If I understand correctly you have a PageField, where someone can select between "Chair" and "Vice Chair" and if they do so they should fill out an email field on this page. 

If your Pagefield consists of exactly three values (empty, 1062, 1063 OR 1061, 1062, 1063) you could do it with this:

!chair_vice=''
!chair_vice=1061

But anyway, have you tried using your second suggestion? Maybe it's already implemented by now.

Link to comment
Share on other sites

Hi @LostKobrakai, thanks for the help.

The Pagefield, to work as I need to, needs be either 1062 OR 1063 to then show the email field. If it is blank, it simply won't show.

So, to generalise...

If Pagefield is empty, no email field.

If Pagefield = 1062 then show email field.

If Pagefield = 1063 then show email field.

So I guess this would work...

chair_vice!=''

If the Pagefield (chair_vice) isn't empty, then show the email field... just tried it... yes this works!

And yep, tried second suggestion... no implementation yet :( Just upgraded too.

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

×
×
  • Create New...