Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. {% macro icon_size(option) %} {% if option == "Small" %}fa-lg{% elif option == "Medium" %}fa-2x{% elif option == "Large" %}fa-3x{% elif option == "Extra Large" %}fa-4x{% elif option == "Extra Extra Large" %}fa-5x{% endif %}{% endmacro %}
  2. {% macro alignment(option) %} {% if option == "Centered" %}center-align{% endif %}{% endmacro %}
  3. {% macro icon_color(option) %} {% if option == "Primary Color" %}iconColor-t1{% elif option == "Second Color" %}iconColor-t2{% elif option == "Third Color" %}iconColor-t3{% elif option == "Fourth Color" %}iconColor-t4{% endif %}{% endmacro %}
  4. {% set table = 1043243 %}
  5. {% set queryparam = "" %}
  6. {% if module.content_type %}
  7. {% set queryparam = queryparam ~ "&media_category="~module.content_type %}
  8. {% endif %}
  9.  
  10. {% set all_media = hubdb_table_rows(table, queryparam) %}
  11.  
  12. <div class="row-fluid title-section">
  13. <div class="span12">
  14. <h2>{{ module.media_title }}</h2>
  15. </div>
  16. </div>
  17. <div class="row-fluid dd-media-section">
  18. {% for media in all_media %}
  19. {% if loop.index <= module.number_of_items_to_display %}
  20. <div class="span4 widget-span generic-bucket{{ alignment(media.content_alignment.name) }} {{ media.type.name|lower }} cm-bu1">
  21.  
  22. {% if media.type.name == "Icon" %}
  23. <div class="icon-block span12">
  24. <i class="fa {{ media.icon_class }} {{ icon_color(media.icon_color.name) }} {{ icon_size(media.icon_size) }}"></i>
  25. </div>
  26. {% endif %}
  27. {% if media.type.name == "Image" %}
  28. <div class="image-block span12">
  29. {% if media.relative_image_link|length > 4 %}
  30. <a href="{{ media.relative_image_link }}">
  31. {% endif %}
  32. <img src="{{ media.image.url }}" width="{{ media.image.width }}" height="{{ media.image.height }}" alt="{{ media.image.alt }}">
  33. {% if media.relative_image_link|length > 4 %}
  34. </a>
  35. {% endif %}
  36. </div>
  37. {% endif %}
  38. {% if media.type.name == "Video" %}
  39. <div class="video-block span12">
  40. {{ media.video_embed_text }}
  41. </div>
  42. {% endif %}
  43. <div class="span12{% if media.type.name != "Image" %} text-block{% endif %} thickFont-t1">
  44. <p>{{ media.name }}</p>
  45. {% if media.type.name == "Image" %}
  46. <p><a target="_blank" href="{{ media.image.url }}" download="{{ media.name|lower|replace(' ', '-') }}.png">Download</a></p>
  47. {% endif %}
  48. </div>
  49. </div>
  50.  
  51.  
  52. {% if loop.index|divisible(3) || loop.last %}
  53. </div>
  54. {% if loop.index < module.number_of_items_to_display %}
  55. <div class="row-fluid">
  56. {% endif %}
  57. {% endif %}
  58. {% endif %}
  59. {% endfor %}
  60.  
  61. </div>
  62.  
  63. <style>
  64. .dd-media-section .image-block img {
  65. max-width: 95%;
  66. margin: 0 auto;
  67. height: auto!important;
  68. }
  69. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement