templates/themes/ismart/part/social.html.twig line 1

Open in your IDE?
  1. {% if post is defined and post is not empty %}
  2. {% set social = getSocialByPost(post) %}
  3.     {% set googleTitle = post.title %}
  4.     {% set googleDescription = post.description %}
  5.     {% set googleTags = post.title %}
  6.     {% set facebookTitle = post.title %}
  7.     {% set facebookDescription = post.description %}
  8.     {% set facebookThumbnail = post.image %}
  9.     {% if social is not empty %}
  10.         {% if social.googleTitle is not empty %}
  11.             {% set googleTitle = social.googleTitle %}
  12.         {% endif %}
  13.         {% if social.googleTag is not empty %}
  14.             {% set googleTags = social.googleTag | join(',') %}
  15.         {% endif %}
  16.         {% if social.googleDescription is not empty %}
  17.             {% set googleDescription = social.googleDescription %}
  18.         {% endif %}
  19.         {% if social.facebookTitle is not empty %}
  20.             {% set facebookTitle = social.facebookTitle %}
  21.         {% endif %}
  22.         {% if social.facebookDescription is not empty %}
  23.             {% set facebookDescription = social.facebookDescription %}
  24.         {% endif %}
  25.         {% if social.facebookThumbnail is not empty %}
  26.             {% set facebookThumbnail = social.facebookThumbnail %}
  27.         {% endif %}
  28.     {% endif %}
  29. <title>{{ googleTitle }}</title>
  30. <meta name="title" content="{{ googleTitle }}">
  31. <meta name="description" content="{{ googleDescription }}"/>
  32. <meta name="keywords" content="{{ googleTags }}">
  33. <meta property="og:locale" content="{{ app.request.get("_locale") }}">
  34. <meta property="og:type" content="website"/>
  35. <meta property="og:title" content="{{ facebookTitle }}"/>
  36. <meta property="og:description" content="{{ facebookDescription }}"/>
  37. <meta property="og:image" content="{{ assets.domain ~ facebookThumbnail }}"/>
  38. {% endif %}
  39. {% if category is defined and category is not empty %}
  40.     <title>{{ category.title }}</title>
  41. {% endif %}