This is an old revision of the document!


Footer fails to output for SNS themes

Problem: The footer fails to output for SNS themes

Cause: The customized theme references user initialized global PHP variables in injected blocks. When those ESI blocks render, null pointer errors occur as those variables have been initialized earlier but the injected block has no way of recognizing them. In SNS themes, this is due to the variable “$var_snstheme” being initialized in the header block.

Solution: Find the code where this variable is initialized and copy this logic to the template of the injected block. For example, adding the following 2 lines:

global $var_snstheme;
if (empty($var_snstheme)) {
    include (dirname(dirname(__FILE__)).'/sns/sns.php');
}

Similarly, for SM themes (such as sm-maxshop yttheme):

if (empty($var_yttheme)) {
        include (dirname(dirname(__FILE__)).'/sm/yt_prepar.php');
}

Alternative Solution: Remove footer block injection. Doing this will slow down page load times and increase cache size, and as such is not recommended.

  • Admin
  • Last modified: 2017/01/25 21:50
  • by Michael Alegre