Answer the question
In order to leave comments, you need to log in
Adding layer in php how?
In the Drupal template, I'm trying to display the layer on the photo, depending on the filling of the field inside the admin panel. I write in the format:
<?php if(!empty($fields['field_video'])) echo '<div class="ribbon-wrapper-gold"><div class="ribbon-gold">with video</div></div>'; ?>
Answer the question
In order to leave comments, you need to log in
Most likely the value of $fields['field_video'] is never empty, so the layer is always rendered.
1) Dump the contents of the value to the screen var_dump($fields['field_video']);
2) Look at the value structure, it is probably an array that contains the value key - which already stores the value that you need to check.
As a result, the check will most likely turn out like this: !empty($fields['field_video']['value']
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question