Browse Source

telecahrger pdf

ouidade 2 years ago
parent
commit
b0ddad726e

+ 1 - 5
user/blueprints/pages/modular/showcase.yaml

@@ -45,11 +45,7 @@ form:
                   validate:
                       type: bool
    
-                .docu:                        
-                  type: file
-                  label: pdf à télécharger
-                  accept:
-                    - .pdf
+      
                 .pdf:                        
                   type: filepicker
                   label: pdf à télécharger

+ 8 - 1
user/themes/epau-antimatter/templates/modular/showcase.html.twig

@@ -9,8 +9,15 @@
         {{ content|raw }}
         <div class="boutons-event">
             {% for button in page.header.buttons %}
-                <a class="bouton{% if button.primary %} primary{% endif %}" href="{{ button.url }}" target="_blank">{{ button.text }}</a>
+                {% if button.url %}
+                <a class="bouton {% if button.primary %} primary{% endif %}" href="{{ button.url }}" target="_blank">{{ button.text }}>
+                {% endif %}
+                {% if button.pdf %}
+                <a class="bouton {% if button.primary %} primary{% endif %}" href="{{page.media[button.pdf].url|e }}" download >{{ button.text }}>
+                {% endif %}
+                    
             {% endfor %}
+            
         </div>
     </div>