Skip to content
This repository has been archived by the owner on Nov 10, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3586 from rogeralloymagnetic/RHDX-408
Browse files Browse the repository at this point in the history
[RHDX-408] Set video_resource card image to FALSE if empty.
  • Loading branch information
staceymosier authored Jun 16, 2020
2 parents eae454f + 5b52ebf commit d5c5e5d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{{ attach_library('classy/node') }}

{% set tmpUrl = content.field_video_thumbnail_url['#items'][0].value %}

{% if '.jpg' in tmpUrl or '.jpeg' in tmpUrl or '.gif' in tmpUrl or '.png' in tmpUrl %}
{% set hero_img = {'#theme':'imagecache_external', '#uri':tmpUrl, '#style_name':'static_item', '#alt':node.label, } %}
{% else %}
{% set hero_img = {'#theme':'imagecache_external', '#uri':tmpUrl, '#style_name':'static_item', '#alt':node.label} %}
{% elseif tmpUrl is not empty %}
{% set hero_img = '<img src="' ~ tmpUrl ~ '" alt="' ~ node.label ~ '" />' %}
{% else %}
{% set hero_img = FALSE %}
{% endif %}

{% include '@components/card.twig' with {
Expand Down

0 comments on commit d5c5e5d

Please sign in to comment.