0

I have a table on my site made with views. I have the User Relationships module installed so users can connect with each other. I want most of the fields to be visible for all users but there is one field that must only be showed if the author of the content and the logged in user have a relation with each other.

Is this even possible? I have tried different settings. It is possible with a filter criteria to hide the complete node if the users aren't related. But that is not what I want. It is just one field of that node type that must be hidden if the users aren't related.

  • try this hope it will help you sitepoint.com/… – Naveen Mar 10 '16 at 11:33
  • If you can add a field for that relationship (ie a value that will show only if it is true) then you could use Views Conditional module or test that field for empty in the Views template and hide your other field – J. Reynolds Mar 10 '16 at 11:55
  • Where do the data come from that this field (to show or hide) is about? Is it like a field of some content type, whereas your view lists various field of nodes related to such content types? – Pierre.Vriens Mar 10 '16 at 14:05
  • I have created a content type called "product" ( it is not a webshop), there are a couple of fields, such as "name", "description" and more. In views there is a table with those products, every user must see this, there is just one field, the "price" field that must only be showed to the user if he has a relationship (build with the User Relationships module) with the author of the content (product). – RvO Mar 10 '16 at 18:16
  • I am going to look into that Views Conditional module, unfortunately that will be tomorrow. – RvO Mar 10 '16 at 18:18
0

The Views Conditional module works for me! Thank you J. Reynolds! I have the price field set to be hidden, and created a conditional field that shows the price field (with the token), if the relationship field (also hidden), haves the value of "the name of the relationship". If it has not that value it shows "----". I am going to fine tune some things around the relationships module but this is exactly what I needed. Thanks again!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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