<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* themes/ismart/part/social.html.twig */
class __TwigTemplate_49b4a662beb2cc23256d8362c4efa96423938f0b98ff2cef4a9b9a0bca1dbeae extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "themes/ismart/part/social.html.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "themes/ismart/part/social.html.twig"));
// line 1
if ((array_key_exists("post", $context) && !Twig\Extension\CoreExtension::testEmpty((isset($context["post"]) || array_key_exists("post", $context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.', 1, $this->source); })())))) {
// line 2
$context["social"] = $this->extensions['App\Backend\SocialBundle\Extension\SocialExtension']->getSocialByPost((isset($context["post"]) || array_key_exists("post", $context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.', 2, $this->source); })()));
// line 3
yield " ";
$context["googleTitle"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["post"]) || array_key_exists("post", $context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.', 3, $this->source); })()), "title", [], "any", false, false, false, 3);
// line 4
yield " ";
$context["googleDescription"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["post"]) || array_key_exists("post", $context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.', 4, $this->source); })()), "description", [], "any", false, false, false, 4);
// line 5
yield " ";
$context["googleTags"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["post"]) || array_key_exists("post", $context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.', 5, $this->source); })()), "title", [], "any", false, false, false, 5);
// line 6
yield " ";
$context["facebookTitle"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["post"]) || array_key_exists("post", $context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.', 6, $this->source); })()), "title", [], "any", false, false, false, 6);
// line 7
yield " ";
$context["facebookDescription"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["post"]) || array_key_exists("post", $context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.', 7, $this->source); })()), "description", [], "any", false, false, false, 7);
// line 8
yield " ";
$context["facebookThumbnail"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["post"]) || array_key_exists("post", $context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.', 8, $this->source); })()), "image", [], "any", false, false, false, 8);
// line 9
yield "
";
// line 10
if ( !Twig\Extension\CoreExtension::testEmpty((isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 10, $this->source); })()))) {
// line 11
yield " ";
if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 11, $this->source); })()), "googleTitle", [], "any", false, false, false, 11))) {
// line 12
yield " ";
$context["googleTitle"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 12, $this->source); })()), "googleTitle", [], "any", false, false, false, 12);
// line 13
yield " ";
}
// line 14
yield " ";
if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 14, $this->source); })()), "googleTag", [], "any", false, false, false, 14))) {
// line 15
yield " ";
$context["googleTags"] = Twig\Extension\CoreExtension::join(CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 15, $this->source); })()), "googleTag", [], "any", false, false, false, 15), ",");
// line 16
yield " ";
}
// line 17
yield " ";
if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 17, $this->source); })()), "googleDescription", [], "any", false, false, false, 17))) {
// line 18
yield " ";
$context["googleDescription"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 18, $this->source); })()), "googleDescription", [], "any", false, false, false, 18);
// line 19
yield " ";
}
// line 20
yield " ";
if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 20, $this->source); })()), "facebookTitle", [], "any", false, false, false, 20))) {
// line 21
yield " ";
$context["facebookTitle"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 21, $this->source); })()), "facebookTitle", [], "any", false, false, false, 21);
// line 22
yield " ";
}
// line 23
yield " ";
if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 23, $this->source); })()), "facebookDescription", [], "any", false, false, false, 23))) {
// line 24
yield " ";
$context["facebookDescription"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 24, $this->source); })()), "facebookDescription", [], "any", false, false, false, 24);
// line 25
yield " ";
}
// line 26
yield " ";
if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 26, $this->source); })()), "facebookThumbnail", [], "any", false, false, false, 26))) {
// line 27
yield " ";
$context["facebookThumbnail"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["social"]) || array_key_exists("social", $context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.', 27, $this->source); })()), "facebookThumbnail", [], "any", false, false, false, 27);
// line 28
yield " ";
}
// line 29
yield " ";
}
// line 30
yield "<title>";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["googleTitle"]) || array_key_exists("googleTitle", $context) ? $context["googleTitle"] : (function () { throw new RuntimeError('Variable "googleTitle" does not exist.', 30, $this->source); })()), "html", null, true);
yield "</title>
<meta name=\"title\" content=\"";
// line 31
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["googleTitle"]) || array_key_exists("googleTitle", $context) ? $context["googleTitle"] : (function () { throw new RuntimeError('Variable "googleTitle" does not exist.', 31, $this->source); })()), "html", null, true);
yield "\">
<meta name=\"description\" content=\"";
// line 33
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["googleDescription"]) || array_key_exists("googleDescription", $context) ? $context["googleDescription"] : (function () { throw new RuntimeError('Variable "googleDescription" does not exist.', 33, $this->source); })()), "html", null, true);
yield "\"/>
<meta name=\"keywords\" content=\"";
// line 35
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["googleTags"]) || array_key_exists("googleTags", $context) ? $context["googleTags"] : (function () { throw new RuntimeError('Variable "googleTags" does not exist.', 35, $this->source); })()), "html", null, true);
yield "\">
<meta property=\"og:locale\" content=\"";
// line 37
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 37, $this->source); })()), "request", [], "any", false, false, false, 37), "get", ["_locale"], "method", false, false, false, 37), "html", null, true);
yield "\">
<meta property=\"og:type\" content=\"website\"/>
<meta property=\"og:title\" content=\"";
// line 40
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["facebookTitle"]) || array_key_exists("facebookTitle", $context) ? $context["facebookTitle"] : (function () { throw new RuntimeError('Variable "facebookTitle" does not exist.', 40, $this->source); })()), "html", null, true);
yield "\"/>
<meta property=\"og:description\" content=\"";
// line 41
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["facebookDescription"]) || array_key_exists("facebookDescription", $context) ? $context["facebookDescription"] : (function () { throw new RuntimeError('Variable "facebookDescription" does not exist.', 41, $this->source); })()), "html", null, true);
yield "\"/>
<meta property=\"og:image\" content=\"";
// line 42
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((CoreExtension::getAttribute($this->env, $this->source, (isset($context["assets"]) || array_key_exists("assets", $context) ? $context["assets"] : (function () { throw new RuntimeError('Variable "assets" does not exist.', 42, $this->source); })()), "domain", [], "any", false, false, false, 42) . (isset($context["facebookThumbnail"]) || array_key_exists("facebookThumbnail", $context) ? $context["facebookThumbnail"] : (function () { throw new RuntimeError('Variable "facebookThumbnail" does not exist.', 42, $this->source); })())), "html", null, true);
yield "\"/>
";
}
// line 44
yield "
";
// line 45
if ((array_key_exists("category", $context) && !Twig\Extension\CoreExtension::testEmpty((isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 45, $this->source); })())))) {
// line 46
yield " <title>";
yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 46, $this->source); })()), "title", [], "any", false, false, false, 46), "html", null, true);
yield "</title>
";
}
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
return; yield '';
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "themes/ismart/part/social.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
return array ( 172 => 46, 170 => 45, 167 => 44, 162 => 42, 158 => 41, 154 => 40, 148 => 37, 143 => 35, 138 => 33, 133 => 31, 128 => 30, 125 => 29, 122 => 28, 119 => 27, 116 => 26, 113 => 25, 110 => 24, 107 => 23, 104 => 22, 101 => 21, 98 => 20, 95 => 19, 92 => 18, 89 => 17, 86 => 16, 83 => 15, 80 => 14, 77 => 13, 74 => 12, 71 => 11, 69 => 10, 66 => 9, 63 => 8, 60 => 7, 57 => 6, 54 => 5, 51 => 4, 48 => 3, 46 => 2, 44 => 1,);
}
public function getSourceContext()
{
return new Source("{% if post is defined and post is not empty %}
{% set social = getSocialByPost(post) %}
{% set googleTitle = post.title %}
{% set googleDescription = post.description %}
{% set googleTags = post.title %}
{% set facebookTitle = post.title %}
{% set facebookDescription = post.description %}
{% set facebookThumbnail = post.image %}
{% if social is not empty %}
{% if social.googleTitle is not empty %}
{% set googleTitle = social.googleTitle %}
{% endif %}
{% if social.googleTag is not empty %}
{% set googleTags = social.googleTag | join(',') %}
{% endif %}
{% if social.googleDescription is not empty %}
{% set googleDescription = social.googleDescription %}
{% endif %}
{% if social.facebookTitle is not empty %}
{% set facebookTitle = social.facebookTitle %}
{% endif %}
{% if social.facebookDescription is not empty %}
{% set facebookDescription = social.facebookDescription %}
{% endif %}
{% if social.facebookThumbnail is not empty %}
{% set facebookThumbnail = social.facebookThumbnail %}
{% endif %}
{% endif %}
<title>{{ googleTitle }}</title>
<meta name=\"title\" content=\"{{ googleTitle }}\">
<meta name=\"description\" content=\"{{ googleDescription }}\"/>
<meta name=\"keywords\" content=\"{{ googleTags }}\">
<meta property=\"og:locale\" content=\"{{ app.request.get(\"_locale\") }}\">
<meta property=\"og:type\" content=\"website\"/>
<meta property=\"og:title\" content=\"{{ facebookTitle }}\"/>
<meta property=\"og:description\" content=\"{{ facebookDescription }}\"/>
<meta property=\"og:image\" content=\"{{ assets.domain ~ facebookThumbnail }}\"/>
{% endif %}
{% if category is defined and category is not empty %}
<title>{{ category.title }}</title>
{% endif %}", "themes/ismart/part/social.html.twig", "/home/ismart/web/ismart.edu.vn/public_html/templates/themes/ismart/part/social.html.twig");
}
}