Hi folks,
I have a view that display unformatted fields :
- a boolean field
- a date field
- a title field
I want to change the title class if boolean field is checke and a date field is lower than current datetime)
My problem is that I can't even make the test on the boolean field :
I first tried
<?php if ($fields["field_boolean"] == '1') :
echo "TRUE";
endif;
?>No error, but the comparison is alwas false
So I tried
<?php if ($fields["field_boolean"] == 1) :
echo "TRUE";
endif;
?>It says : "Object of class stdClass could not be converted to int in include()"
Then I tried
<?php
if (isset($content['field_boolean'][LANGUAGE_NONE][0]['value'])) :
if ($content['field_boolean'][LANGUAGE_NONE][0]['value'] == 0) :
echo "TRUE";
endif;
endif;
?>The views is broken
Any idea ?
Comments
Comment #1
saurabh.dhariwal commentedYou can get your field value with below code.
You can print your field columnname with below code.
Hope this helps you.
Thanks!
Comment #2
renatog commentedHi @thibaut51 how are you?
#1 is an solution for your case.
You can make the condition and print your value using print_r, drupal_set_message, and others.
RTBC
Comment #3
renatog commentedThanks @saurabh.dhariwal
@thibaut51; Any question, please comment for us.
Thanks.