I have been working with Drupal for some months now but I have not coded anything in it so I need help.
Situation: On my homepage there are 3 rows that contain blog teasers. On the first row the first video (youtube/vimeo) and the first image of the blog is shown. They are all styled responsively and it works fine. I use a view to do this.
What needs to change: When there is a video in the blog, I want to exclude the image. So Video = No image, No video = Image, No video and No image = just the teaser text (which is always present).
What I have tried: Tried the Views Conditional module. Doesn't work since the replacement variable (example [photo]) does not contain the image itself.
Tried Views If Empty module. The logic works but messes up my CSS in a lot of ways and impossible to make it look like it should.
Solution?: I think that what I need is a PHP part in my View. I have no experience at all with making this. What I have tried is visible below. (messes up the homepage).
if (empty($fields[$row->field_alg_video_1]->last_render)) {
$this->last_render = $fields[$row->field_alb_fotos]->last_render;
}
else {
$this->last_render = '';
}
I just threw some stuff together from the net. Can anyone help me out? :)