瀏覽代碼

add embed

kevin 3 年之前
父節點
當前提交
acb8050fb4
共有 1 個文件被更改,包括 11 次插入3 次删除
  1. 11 3
      web/themes/custom/popsu_colloque/template/node/node--moments.html.twig

+ 11 - 3
web/themes/custom/popsu_colloque/template/node/node--moments.html.twig

@@ -75,10 +75,18 @@
 #}
 <article class="row" id="moments">
   <div class="__wrapper col-sm-12 col-md-9">
-    <div class="__img-hero">
-    {{content.field_image}}
-    </div>
 
+    {% if content.field_embed['#items'] %}
+      <div class="__img-hero">
+        {{content.field_embed}}
+      </div>   
+      {% else %}
+      <div class="__img-hero">
+        {{content.field_image}}
+      </div>
+ 
+    {% endif %}
+  
     <div class="__title col-12 px-0">
       <h2>{{label}}</h2>
     </div>