0

On my homepage blog messages from the users are shown. When a user adds a Youtube movie and/or one or more pictures these are shown as a preview. The thing is though that when a user picks a movie and one or more pictures the home page message show the Youtube movie and the picture. But when both are added to a blog message I only want to see the youtube preview, so Youtube is more important than the picture so the picture should not be shown. When there are only pictures 1 picture is shown (this works fine). How can I change something in my View to make it prioritize Youtube over the picture so it doesn't the picture when there is a Youtube movie.

Screenie of what I have now, so the picture has to leave: http://imageshack.com/a/img844/1833/bqer.jpg

I have a multisite setup with 11 websites so the easiest solution is welcome :)

Thanks in advance!

1 Answer 1

1

Use the Views Conditional module. It does exactly what you want to achieve.

How to use Views Conditional in your Views:

  1. Create a view. Add some fields under "FIELDS".
  2. Click on "ADD" next to fields. Scroll down to "Views: Views Conditional", probably found near the bottom of the list.
  3. Add and configure fields...
  4. Choose a field to run a condition against, and provide values accordingly.
  5. Save, views conditional handles the logic and returns as specified.
2
  • You might need to hide the fields from display and then use them after the condition probably.
    – Gokul N K
    Feb 12, 2014 at 9:52
  • Looks like the answer I need! Thanks! Will come back here if I have problems but I think it's ok :D Feb 12, 2014 at 9:55

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.