Condition on widget


Hi, I created a new widget. I want to make the widget available to certain logged in users such as the ContactType field. How can I achieve this? Thank you


I believe if you return "False" inside of the getData method, the view will not load and display.
In this method you would first check to see if the contact is logged in, then see if the field of interest has the correct value.

If it doesn't, return false.

Yes, this is exactly what i did. I made the controller widget check the logged in user session and see what type of user he is. this was little bit tweaked cause the session does not hold the ContactType. I returned True if the user has the contact type desired and did an if condition on the wdget view. Thank you

Zircon - This is a contributing Drupal Theme
Design by WeebPal.