I'm trying to display a long text field when a boolean field in a Profile2 profile is set as true.

I have the output code field set as such:

<?php if($row->field_bool) { print $row->field_long-text-field; } else print 'returned false'; ?>

This code doesn't return any errors and seems to work fairly well aside from the fact that it doesn't return the text in the text field, it just returns the number 3. I tried as seen in other threads to use $data->field_long-text-field[0]['und']['value'] which doesn't return any errors either but it just returns blank. I've tried several variations of this and looked through numerous issues to find some example of what i'm trying to do but was unable to find anything.

I'm by no means a experienced php programmer and i'd appreciate if anyone could point out the error that i'm making or how to print the contents of the field correctly.

Comments

NoRandom’s picture

Same problem here. I have two different imagecache presets for an image and I would like to render one of them based on a third field. It would be great if PHP Views had access to standard views fields like [field_cover], [field_title], etc...