0

I need to check whether there is already a registered user having the same user email or username. Right now I have two Views (one with passing the username and one with passing the user email as contextual filter). When there is no user with the username, the second view is called.

There is the "allow multiple values" setting for the contextual filter, but this allows me to pass 2 emails, but not an email or a username for instance.

Is there a way to create one View where the user enters a value (name or email) as filter?

SOLUTION:

As suggested by Marco that works well:

enter image description here

3
  • 1
    You can create a view with a context filter for username and a context filter for usermail. Then check the input of the user, if it is a email adress. If it is a email you can redirect to the view and set the context filter for the username to "all" and the context filter for the mail to the user input. If it is no mail adress you can set the context filter for the usermail to "all" and the context filter of the username to the userinput and redirect to this path.
    – schneidolf
    Commented Jun 5, 2017 at 6:05
  • Thanks Marco. Why didnt you post this as answer? I gladly accept it.
    – user24957
    Commented Jun 5, 2017 at 6:16
  • I was not sure if this is what you search for. I provided my solution as answer.
    – schneidolf
    Commented Jun 5, 2017 at 6:22

1 Answer 1

1

You can create a view with a context filter for username and a context filter for usermail.

Then check the input of the user, if it is a email adress. If it is a email you can redirect to the view and set the context filter for the username to "all" and the context filter for the mail to the user input.

If it is no mail adress you can set the context filter for the usermail to "all" and the context filter of the username to the userinput and redirect to this path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.