custom/plugins/TcinnThemeWareLiving/src/Resources/views/storefront/themeware/widgets/twt-communities-include.html.twig line 1

Open in your IDE?
  1. {# ThemeWare "Communities" widget #}
  2. {#
  3.     Create "Communities" widget and add content
  4.     @Storefront/storefront/themeware/widgets/twt-communities-include.html.twig
  5. #}
  6. {# TODO: Blöcke prüfen... #}
  7. {# TODO:
  8.     - Add floating option...
  9.     - Add usp-bar option...
  10. #}
  11. {# ---------------- START: SET TEMPLATE VARS ---------------- #}
  12. {# ThemeWare: Set theme variables #}
  13. {% set twtWidgetCommunitiesAdditionalTextShow = theme_config('twt-widget-communities-additional-text-show') %}
  14. {% set twtWidgetCommunitiesBlog = theme_config('twt-widget-communities-blog') %}
  15. {% set twtWidgetCommunitiesBlogger = theme_config('twt-widget-communities-blogger') %}
  16. {% set twtWidgetCommunitiesFacebook = theme_config('twt-widget-communities-facebook') %}
  17. {% set twtWidgetCommunitiesFlickr = theme_config('twt-widget-communities-flickr') %}
  18. {% set twtWidgetCommunitiesIconStyle = theme_config('twt-widget-communities-icon-style') %}
  19. {% set twtWidgetCommunitiesInstagram = theme_config('twt-widget-communities-instagram') %}
  20. {% set twtWidgetCommunitiesLinkedin = theme_config('twt-widget-communities-linkedin') %}
  21. {% set twtWidgetCommunitiesPinterest = theme_config('twt-widget-communities-pinterest') %}
  22. {% set twtWidgetCommunitiesTiktok = theme_config('twt-widget-communities-tiktok') %}
  23. {% set twtWidgetCommunitiesTwitch = theme_config('twt-widget-communities-twitch') %}
  24. {% set twtWidgetCommunitiesTwitter = theme_config('twt-widget-communities-twitter') %}
  25. {% set twtWidgetCommunitiesVimeo = theme_config('twt-widget-communities-vimeo') %}
  26. {% set twtWidgetCommunitiesWebsite = theme_config('twt-widget-communities-website') %}
  27. {% set twtWidgetCommunitiesWhatsapp = theme_config('twt-widget-communities-whatsapp') %}
  28. {% set twtWidgetCommunitiesXing = theme_config('twt-widget-communities-xing') %}
  29. {% set twtWidgetCommunitiesYoutube = theme_config('twt-widget-communities-youtube') %}
  30. {# ---------------- END: SET TEMPLATE VARS ---------------- #}
  31. {% if twtWidgetCommunitiesIconStyle == 1 %}
  32.     {% set style = 'default' %}
  33. {% elseif twtWidgetCommunitiesIconStyle == 2 %}
  34.     {% set style = 'isolated' %}
  35. {% elseif twtWidgetCommunitiesIconStyle == 3 %}
  36.     {% set style = 'badge' %}
  37. {% elseif twtWidgetCommunitiesIconStyle == 4 %}
  38.     {% set style = 'square' %}
  39. {% elseif twtWidgetCommunitiesIconStyle == 5 %}
  40.     {% set style = 'circle' %}
  41. {% elseif twtWidgetCommunitiesIconStyle == 6 %}
  42.     {% set style = 'default-mono' %}
  43. {% elseif twtWidgetCommunitiesIconStyle == 7 %}
  44.     {% set style = 'isolated-mono' %}
  45. {% elseif twtWidgetCommunitiesIconStyle == 8 %}
  46.     {% set style = 'badge-mono' %}
  47. {% elseif twtWidgetCommunitiesIconStyle == 9 %}
  48.     {% set style = 'square-mono' %}
  49. {% elseif twtWidgetCommunitiesIconStyle == 10 %}
  50.     {% set style = 'circle-mono' %}
  51. {% endif %}
  52. {# ThemeWare: Overwrite icon style when its slideout #}
  53. {% if type == 'slideout' %}
  54.     {% set style = 'square' %}
  55. {% endif %}
  56. {# ThemeWare: Overwrite icon style when its in USP bar #}
  57. {% if type == 'usp-bar' %}
  58.     {% set style = 'default-mono' %}
  59. {% endif %}
  60. {# ThemeWare: Social icons #}
  61. {% block twt_widget_communities %}
  62.     <div class="twt-widget-communities twt-communities{% if type == 'slideout' %} is-slideout{% endif %}{% if type == 'sidebar' %} is-sidebar{% endif %}{% if type == 'cms' %} is-cms{% endif %}{% if type == 'usp-bar' %} is-usp-bar{% endif %}">
  63.         {% block twt_widget_communities_content %}
  64.             {% if twtWidgetCommunitiesAdditionalTextShow == 2 %}
  65.                 <div class="twt-communities-additional-text">
  66.                     <p>{{ "twt.widget.communities.additionalText"|trans|sw_sanitize }}</p>
  67.                 </div>
  68.             {% endif %}
  69.             <ul class="twt-communities-list">
  70.                 {# ThemeWare: Facebook logo #}
  71.                 {% if twtWidgetCommunitiesFacebook == 2 %}
  72.                     {% block twt_widget_communities_facebook %}
  73.                         {% set icon = 'facebook' %}
  74.                         <li class="twt-communities-item item-{{ icon }}">
  75.                             <a href="{{ "twt.widget.communities.facebook.link"|trans|sw_sanitize }}"
  76.                                aria-label="{{ "twt.widget.communities.facebook.name"|trans|sw_sanitize }}"
  77.                                title="{{ "twt.widget.communities.facebook.name"|trans|sw_sanitize }}"
  78.                                class="twt-communities-link link-facebook"
  79.                                rel="noopener"
  80.                                target="_blank">
  81.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  82.                                     icon: icon,
  83.                                     style: style
  84.                                 } %}
  85.                                 <span class="twt-communities-label">
  86.                                     {{ "twt.widget.communities.facebook.name"|trans|sw_sanitize }}
  87.                                 </span>
  88.                             </a>
  89.                         </li>
  90.                     {% endblock %}
  91.                 {% endif %}
  92.                 {# ThemeWare: Instagram #}
  93.                 {% if twtWidgetCommunitiesInstagram == 2 %}
  94.                     {% block twt_widget_communities_instagram %}
  95.                         {% set icon = 'instagram' %}
  96.                         <li class="twt-communities-item item-{{ icon }}">
  97.                             <a href="{{ "twt.widget.communities.instagram.link"|trans|sw_sanitize }}"
  98.                                aria-label="{{ "twt.widget.communities.instagram.name"|trans|sw_sanitize }}"
  99.                                title="{{ "twt.widget.communities.instagram.name"|trans|sw_sanitize }}"
  100.                                class="twt-communities-link link-instagram"
  101.                                rel="noopener"
  102.                                target="_blank">
  103.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  104.                                     icon: icon,
  105.                                     style: style
  106.                                 } %}
  107.                                 <span class="twt-communities-label">
  108.                                     {{ "twt.widget.communities.instagram.name"|trans|sw_sanitize }}
  109.                                 </span>
  110.                             </a>
  111.                         </li>
  112.                     {% endblock %}
  113.                 {% endif %}
  114.                 {# ThemeWare: Twitter #}
  115.                 {% if twtWidgetCommunitiesTwitter == 2 %}
  116.                     {% block twt_widget_communities_twitter %}
  117.                         {% set icon = 'twitter' %}
  118.                         <li class="twt-communities-item item-{{ icon }}">
  119.                             <a href="{{ "twt.widget.communities.twitter.link"|trans|sw_sanitize }}"
  120.                                aria-label="{{ "twt.widget.communities.twitter.name"|trans|sw_sanitize }}"
  121.                                title="{{ "twt.widget.communities.twitter.name"|trans|sw_sanitize }}"
  122.                                class="twt-communities-link link-twitter"
  123.                                rel="noopener"
  124.                                target="_blank">
  125.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  126.                                     icon: icon,
  127.                                     style: style
  128.                                 } %}
  129.                                 <span class="twt-communities-label">
  130.                                     {{ "twt.widget.communities.twitter.name"|trans|sw_sanitize }}
  131.                                 </span>
  132.                             </a>
  133.                         </li>
  134.                     {% endblock %}
  135.                 {% endif %}
  136.                 {# ThemeWare: Youtbe #}
  137.                 {% if twtWidgetCommunitiesYoutube == 2 %}
  138.                     {% block twt_widget_communities_youtube %}
  139.                         {% set icon = 'youtube' %}
  140.                         <li class="twt-communities-item item-{{ icon }}">
  141.                             <a href="{{ "twt.widget.communities.youtube.link"|trans|sw_sanitize }}"
  142.                                aria-label="{{ "twt.widget.communities.youtube.name"|trans|sw_sanitize }}"
  143.                                title="{{ "twt.widget.communities.youtube.name"|trans|sw_sanitize }}"
  144.                                class="twt-communities-link link-youtube"
  145.                                rel="noopener"
  146.                                target="_blank">
  147.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  148.                                     icon: icon,
  149.                                     style: style
  150.                                 } %}
  151.                                 <span class="twt-communities-label">
  152.                                     {{ "twt.widget.communities.youtube.name"|trans|sw_sanitize }}
  153.                                 </span>
  154.                             </a>
  155.                         </li>
  156.                     {% endblock %}
  157.                 {% endif %}
  158.                 {# ThemeWare: Vimeo #}
  159.                 {% if twtWidgetCommunitiesVimeo == 2 %}
  160.                     {% block twt_widget_communities_vimeo %}
  161.                         {% set icon = 'vimeo' %}
  162.                         <li class="twt-communities-item item-{{ icon }}">
  163.                             <a href="{{ "twt.widget.communities.vimeo.link"|trans|sw_sanitize }}"
  164.                                aria-label="{{ "twt.widget.communities.vimeo.name"|trans|sw_sanitize }}"
  165.                                title="{{ "twt.widget.communities.vimeo.name"|trans|sw_sanitize }}"
  166.                                class="twt-communities-link link-vimeo"
  167.                                rel="noopener"
  168.                                target="_blank">
  169.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  170.                                     icon: icon,
  171.                                     style: style
  172.                                 } %}
  173.                                 <span class="twt-communities-label">
  174.                                     {{ "twt.widget.communities.vimeo.name"|trans|sw_sanitize }}
  175.                                 </span>
  176.                             </a>
  177.                         </li>
  178.                     {% endblock %}
  179.                 {% endif %}
  180.                 {# ThemeWare: Twitch #}
  181.                 {% if twtWidgetCommunitiesTwitch == 2 %}
  182.                     {% block twt_widget_communities_twitch %}
  183.                         {% set icon = 'twitch' %}
  184.                         <li class="twt-communities-item item-{{ icon }}">
  185.                             <a href="{{ "twt.widget.communities.twitch.link"|trans|sw_sanitize }}"
  186.                                aria-label="{{ "twt.widget.communities.twitch.name"|trans|sw_sanitize }}"
  187.                                title="{{ "twt.widget.communities.twitch.name"|trans|sw_sanitize }}"
  188.                                class="twt-communities-link link-twitch"
  189.                                rel="noopener"
  190.                                target="_blank">
  191.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  192.                                     icon: icon,
  193.                                     style: style
  194.                                 } %}
  195.                                 <span class="twt-communities-label">
  196.                                     Twitch{#{ "twt.widget.communities.twitch.name"|trans|sw_sanitize }#}
  197.                                 </span>
  198.                             </a>
  199.                         </li>
  200.                     {% endblock %}
  201.                 {% endif %}
  202.                 {# ThemeWare: Flickr #}
  203.                 {% if twtWidgetCommunitiesFlickr == 2 %}
  204.                     {% block twt_widget_communities_flickr %}
  205.                         {% set icon = 'flickr' %}
  206.                         <li class="twt-communities-item item-{{ icon }}">
  207.                             <a href="{{ "twt.widget.communities.flickr.link"|trans|sw_sanitize }}"
  208.                                aria-label="{{ "twt.widget.communities.flickr.name"|trans|sw_sanitize }}"
  209.                                title="{{ "twt.widget.communities.flickr.name"|trans|sw_sanitize }}"
  210.                                class="twt-communities-link link-flickr"
  211.                                rel="noopener"
  212.                                target="_blank">
  213.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  214.                                     icon: icon,
  215.                                     style: style
  216.                                 } %}
  217.                                 <span class="twt-communities-label">
  218.                                     {{ "twt.widget.communities.flickr.name"|trans|sw_sanitize }}
  219.                                 </span>
  220.                             </a>
  221.                         </li>
  222.                     {% endblock %}
  223.                 {% endif %}
  224.                 {# ThemeWare: Pinterest #}
  225.                 {% if twtWidgetCommunitiesPinterest == 2 %}
  226.                     {% block twt_widget_communities_pinterest %}
  227.                         {% set icon = 'pinterest' %}
  228.                         <li class="twt-communities-item item-{{ icon }}">
  229.                             <a href="{{ "twt.widget.communities.pinterest.link"|trans|sw_sanitize }}"
  230.                                aria-label="{{ "twt.widget.communities.pinterest.name"|trans|sw_sanitize }}"
  231.                                title="{{ "twt.widget.communities.pinterest.name"|trans|sw_sanitize }}"
  232.                                class="twt-communities-link link-pinterest"
  233.                                rel="noopener"
  234.                                target="_blank">
  235.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  236.                                     icon: icon,
  237.                                     style: style
  238.                                 } %}
  239.                                 <span class="twt-communities-label">
  240.                                     {{ "twt.widget.communities.pinterest.name"|trans|sw_sanitize }}
  241.                                 </span>
  242.                             </a>
  243.                         </li>
  244.                     {% endblock %}
  245.                 {% endif %}
  246.                 {# ThemeWare: TikTok #}
  247.                 {% if twtWidgetCommunitiesTiktok == 2 %}
  248.                     {% block twt_widget_communities_tiktok %}
  249.                         {% set icon = 'tiktok' %}
  250.                         <li class="twt-communities-item item-{{ icon }}">
  251.                             <a href="{{ "twt.widget.communities.tiktok.link"|trans|sw_sanitize }}"
  252.                                aria-label="{{ "twt.widget.communities.tiktok.name"|trans|sw_sanitize }}"
  253.                                title="{{ "twt.widget.communities.tiktok.name"|trans|sw_sanitize }}"
  254.                                class="twt-communities-link link-tiktok"
  255.                                rel="noopener"
  256.                                target="_blank">
  257.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  258.                                     icon: icon,
  259.                                     style: style
  260.                                 } %}
  261.                                 <span class="twt-communities-label">
  262.                                     {{ "twt.widget.communities.tiktok.name"|trans|sw_sanitize }}
  263.                                 </span>
  264.                             </a>
  265.                         </li>
  266.                     {% endblock %}
  267.                 {% endif %}
  268.                 {# ThemeWare: Blogger #}
  269.                 {% if twtWidgetCommunitiesBlogger == 2 %}
  270.                     {% block twt_widget_communities_blogger %}
  271.                         {% set icon = 'blogger' %}
  272.                         <li class="twt-communities-item item-{{ icon }}">
  273.                             <a href="{{ "twt.widget.communities.blogger.link"|trans|sw_sanitize }}"
  274.                                aria-label="{{ "twt.widget.communities.blogger.name"|trans|sw_sanitize }}"
  275.                                title="{{ "twt.widget.communities.blogger.name"|trans|sw_sanitize }}"
  276.                                class="twt-communities-link link-blogger"
  277.                                rel="noopener"
  278.                                target="_blank">
  279.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  280.                                     icon: icon,
  281.                                     style: style
  282.                                 } %}
  283.                                 <span class="twt-communities-label">
  284.                                     {{ "twt.widget.communities.blogger.name"|trans|sw_sanitize }}
  285.                                 </span>
  286.                             </a>
  287.                         </li>
  288.                     {% endblock %}
  289.                 {% endif %}
  290.                 {# ThemeWare: Blog (WordPress) #}
  291.                 {% if twtWidgetCommunitiesBlog == 2 %}
  292.                     {% block twt_widget_communities_blog %}
  293.                         {% set icon = 'wordpress' %}
  294.                         <li class="twt-communities-item item-blog">
  295.                             <a href="{{ "twt.widget.communities.blog.link"|trans|sw_sanitize }}"
  296.                                aria-label="{{ "twt.widget.communities.blog.name"|trans|sw_sanitize }}"
  297.                                title="{{ "twt.widget.communities.blog.name"|trans|sw_sanitize }}"
  298.                                class="twt-communities-link link-blog"
  299.                                rel="noopener"
  300.                                target="_blank">
  301.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  302.                                     icon: icon,
  303.                                     style: style
  304.                                 } %}
  305.                                 <span class="twt-communities-label">
  306.                                     {{ "twt.widget.communities.blog.name"|trans|sw_sanitize }}
  307.                                 </span>
  308.                             </a>
  309.                         </li>
  310.                     {% endblock %}
  311.                 {% endif %}
  312.                 {# ThemeWare: WhatsApp #}
  313.                 {% if twtWidgetCommunitiesWhatsapp == 2 %}
  314.                     {% block twt_widget_communities_whatsapp %}
  315.                         {% set icon = 'whatsapp' %}
  316.                         <li class="twt-communities-item item-{{ icon }}">
  317.                             <a href="{{ "twt.widget.communities.whatsapp.link"|trans|sw_sanitize }}"
  318.                                aria-label="{{ "twt.widget.communities.whatsapp.name"|trans|sw_sanitize }}"
  319.                                title="{{ "twt.widget.communities.whatsapp.name"|trans|sw_sanitize }}"
  320.                                class="twt-communities-link link-whatsapp"
  321.                                rel="noopener"
  322.                                target="_blank">
  323.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  324.                                     icon: icon,
  325.                                     style: style
  326.                                 } %}
  327.                                 <span class="twt-communities-label">
  328.                                     {{ "twt.widget.communities.whatsapp.name"|trans|sw_sanitize }}
  329.                                 </span>
  330.                             </a>
  331.                         </li>
  332.                     {% endblock %}
  333.                 {% endif %}
  334.                 {# ThemeWare: LinkedIn #}
  335.                 {% if twtWidgetCommunitiesLinkedin == 2 %}
  336.                     {% block twt_widget_communities_linkedin %}
  337.                         {% set icon = 'linkedin' %}
  338.                         <li class="twt-communities-item item-{{ icon }}">
  339.                             <a href="{{ "twt.widget.communities.linkedin.link"|trans|sw_sanitize }}"
  340.                                aria-label="{{ "twt.widget.communities.linkedin.name"|trans|sw_sanitize }}"
  341.                                title="{{ "twt.widget.communities.linkedin.name"|trans|sw_sanitize }}"
  342.                                class="twt-communities-link link-linkedin"
  343.                                rel="noopener"
  344.                                target="_blank">
  345.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  346.                                     icon: icon,
  347.                                     style: style
  348.                                 } %}
  349.                                 <span class="twt-communities-label">
  350.                                     {{ "twt.widget.communities.linkedin.name"|trans|sw_sanitize }}
  351.                                 </span>
  352.                             </a>
  353.                         </li>
  354.                     {% endblock %}
  355.                 {% endif %}
  356.                 {# ThemeWare: Xing #}
  357.                 {% if twtWidgetCommunitiesXing == 2 %}
  358.                     {% block twt_widget_communities_xing %}
  359.                         {% set icon = 'xing' %}
  360.                         <li class="twt-communities-item item-{{ icon }}">
  361.                             <a href="{{ "twt.widget.communities.xing.link"|trans|sw_sanitize }}"
  362.                                aria-label="{{ "twt.widget.communities.xing.name"|trans|sw_sanitize }}"
  363.                                title="{{ "twt.widget.communities.xing.name"|trans|sw_sanitize }}"
  364.                                class="twt-communities-link link-xing"
  365.                                rel="noopener"
  366.                                target="_blank">
  367.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  368.                                     icon: icon,
  369.                                     style: style
  370.                                 } %}
  371.                                 <span class="twt-communities-label">
  372.                                     {{ "twt.widget.communities.xing.name"|trans|sw_sanitize }}
  373.                                 </span>
  374.                             </a>
  375.                         </li>
  376.                     {% endblock %}
  377.                 {% endif %}
  378.                 {# ThemeWare: eMail #}
  379.                 {# ThemeWare: Website #}
  380.                 {% if twtWidgetCommunitiesWebsite == 2 %}
  381.                     {% block twt_widget_communities_website %}
  382.                         {% set icon = 'website' %}
  383.                         <li class="twt-communities-item item-{{ icon }}">
  384.                             <a href="{{ "twt.widget.communities.website.link"|trans|sw_sanitize }}"
  385.                                aria-label="{{ "twt.widget.communities.website.name"|trans|sw_sanitize }}"
  386.                                title="{{ "twt.widget.communities.website.name"|trans|sw_sanitize }}"
  387.                                class="twt-communities-link link-website"
  388.                                rel="noopener"
  389.                                target="_blank">
  390.                                 {% sw_include '@Storefront/storefront/themeware/twt-social-icons.html.twig' ignore missing with {
  391.                                     icon: icon,
  392.                                     style: style
  393.                                 } %}
  394.                                 <span class="twt-communities-label">
  395.                                     {{ "twt.widget.communities.website.name"|trans|sw_sanitize }}
  396.                                 </span>
  397.                             </a>
  398.                         </li>
  399.                     {% endblock %}
  400.                 {% endif %}
  401.             </ul>
  402.         {% endblock %}
  403.         
  404.     </div>
  405. {% endblock %}