title: Smarty error after hardcoding ps_socialfollow.tpl to support multilanguage
body: <p>My prestashop version is 1.7.3.4 on php 7.1. </p>
  
  <p>This is the default content of ps_socialfollow.tpl:</p>
  
  <pre><code> {block name='block_social'}
    &lt;div class="social_follow"&gt;
      &lt;ul&gt;
        {foreach from=$social_links item='social_link'}
          &lt;li class="{$social_link.class}"&gt;&lt;a href="{$social_link.url}" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
        {/foreach}
      &lt;/ul&gt;
    &lt;/div&gt;
  {/block}
  </code></pre>
  
  <p>The module by default doesn't support multi language. So I've hard coded it to support multi language like this:</p>
  
  <pre><code>{block name='block_social'}
  {if $language.language_code == 'en-us'}
   &lt;div class="social_follow"&gt;
      &lt;ul&gt;
          &lt;li class="facebook"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="twitter"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="instagram"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="googleplus"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="pinterest"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  
  {elseif $language.language_code == 'ko'}
    &lt;div class="social_follow"&gt;
      &lt;ul&gt;
          &lt;li class="facebook"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="twitter"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="instagram"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="googleplus"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="pinterest"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  
  {/if}
  
  {/block}
  </code></pre>
  
  <p>This works flawlessly as long as I don't activate the debug mode. Once I activate the debug mode, I get this error message:</p>
  
  <pre><code>&gt;   ContextErrorException in smarty_internal_templatebase.php(157) :
  &gt; eval()'d code line 68:
  &gt;     Notice: Undefined index: social_link
  &gt;     in smarty_internal_templatebase.php(157) : eval()'d code line 68
  &gt;     at ErrorHandler-&gt;handleError('8', 'Undefined index: social_link', '/var/www/html/store/vendor/prestashop/smarty/sysplugins/smarty_internal_templatebase.php(157)
  &gt; : eval()'d code', '68', array('_smarty_tpl' =&gt;
  &gt; object(SmartyDevTemplate))) in smarty_internal_templatebase.php(157) :
  &gt; eval()'d code line 68
  &gt;     at content_5b4fc96564eec0_18848187(object(SmartyDevTemplate)) in smarty_internal_templatebase.php line 188
  &gt;     at Smarty_Internal_TemplateBase-&gt;fetch(object(SmartyDevTemplate), null, null, null, false, true, false) in SmartyDevTemplate.php line 41
  &gt;     at SmartyDevTemplateCore-&gt;fetch() in Module.php line 2282
  &gt;     at ModuleCore-&gt;fetch('module:ps_socialfollow/ps_socialfollow.tpl', 'ps_socialfollow|1|3|3|3|1|1') in ps_socialfollow.php line 201
  &gt;     at Ps_Socialfollow-&gt;renderWidget('displayFooterAfter', array('smarty' =&gt; object(SmartyDevTemplate), 'cookie' =&gt;
  &gt; object(Cookie), 'cart' =&gt; object(Cart), 'altern' =&gt; '1')) in Hook.php
  &gt; line 929
  &gt;     at HookCore::coreRenderWidget(object(Ps_Socialfollow), 'displayFooterAfter', array('smarty' =&gt; object(SmartyDevTemplate),
  &gt; 'cookie' =&gt; object(Cookie), 'cart' =&gt; object(Cart), 'altern' =&gt; '1'))
  &gt; in Hook.php line 881
  &gt;     at HookCore::exec('displayFooterAfter', array('smarty' =&gt; object(SmartyDevTemplate), 'cookie' =&gt; object(Cookie), 'cart' =&gt;
  &gt; object(Cart), 'altern' =&gt; '1'), null) in smarty.config.inc.php line
  &gt; 168
  &gt;     at smartyHook(array('h' =&gt; 'displayFooterAfter'), object(SmartyDevTemplate)) in SmartyLazyRegister.php line 83
  &gt;     at SmartyLazyRegister-&gt;__call('smartyHook', array(array('h' =&gt; 'displayFooterAfter'), object(SmartyDevTemplate))) in
  &gt; smarty_internal_templatebase.php(157) : eval()'d code line 691
  &gt;     at content_5b4fc96527b774_70366195(object(SmartyDevTemplate)) in smarty_internal_templatebase.php(157) : eval()'d code line 248
  &gt;     at content_5b4fc965282d34_37575711(object(SmartyDevTemplate)) in smarty_internal_templatebase.php line 188
  &gt;     at Smarty_Internal_TemplateBase-&gt;fetch('index.tpl', null, 'layouts/layout-full-width.tpl', object(SmartyDev), false, true,
  &gt; false) in SmartyDev.php line 41
  &gt;     at SmartyDev-&gt;fetch('index.tpl', null, 'layouts/layout-full-width.tpl') in FrontController.php line 684
  &gt;     at FrontControllerCore-&gt;smartyOutputContent('index.tpl') in FrontController.php line 668
  &gt;     at FrontControllerCore-&gt;display() in Controller.php line 273
  &gt;     at ControllerCore-&gt;run() in Dispatcher.php line 428
  &gt;     at DispatcherCore-&gt;dispatch() in index.php line 28
  </code></pre>
  
  <p>My knowledge of php is not even worth mentioning, since it's more based on the little bit of logical thinking I'm capable of doing, rather than actual knowledge. Thus, I'm unable to fix the smarty error on my own. </p>
  
  <p>What'd be the modification I had to do? What'd be the proper way of implementing multi language (website) support into this module?</p>
  
  <p>I've edited the ps_socialfollow.tpl according to Alexander Grosul's suggestion. </p>
  
  <pre><code>  &lt;div class="social_follow"&gt;
      &lt;ul&gt;
          &lt;li class="facebook"&gt;&lt;a href="" target="_blank"&gt;{$social_link.facebook.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="twitter"&gt;&lt;a href="" target="_blank"&gt;{$social_link.twitter.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="instagram"&gt;&lt;a href="" target="_blank"&gt;{$social_link.instagram.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="googleplus"&gt;&lt;a href="" target="_blank"&gt;{$social_link.googleplus.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="pinterest"&gt;&lt;a href="" target="_blank"&gt;{$social_link.pinterest.label}&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>The result is the exact same smarty error. </p>
  
  <p>I've also tried this version: </p>
  
  <pre><code>{block name='block_social'}
    &lt;div class="social_follow"&gt;
      &lt;ul&gt;
        {foreach from=$social_links item='social_link'}
  
  {if $language.language_code == 'en-us'}
           &lt;li class="facebook"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="twitter"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="instagram"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="googleplus"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="pinterest"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
  
  
  
  {elseif $language.language_code == 'ko'}
          &lt;li class="facebook"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="twitter"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="instagram"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="googleplus"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
          &lt;li class="pinterest"&gt;&lt;a href="" target="_blank"&gt;{$social_link.label}&lt;/a&gt;&lt;/li&gt;
  
  {/if}
  
  {/foreach}
   &lt;/ul&gt;
    &lt;/div&gt;
  {/block}
  </code></pre>
  
  <p>Which didn't trigger a smarty error but just displayes all of the icons. at once, regardles sof the selected language. </p>