Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
litespeed_wiki:cache:litemage:troubleshooting:uninitialized-php-vars-injected-block [2017/05/03 21:35]
Jackson Zhang
litespeed_wiki:cache:litemage:troubleshooting:uninitialized-php-vars-injected-block [2017/05/08 19:22] (current)
Lisa Clarke
Line 1: Line 1:
-====== Footer ​fails to output ​for SNS themes , SM themes or other themes ​======+~~NOTOC~~ 
 +====== Footer ​Fails to Output ​for Some Themes ​======
  
-**Problem**: The footer fails to output for SNS themes, SM themes or other themes+==== Problem ​==== 
 +The footer fails to output for SNS themes, SM themes or other 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.+==== 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, or to the top of the template.+==== Solution ​==== 
 +Find the code where this variable is initialized and copy this logic to the template of the injected block, or to the top of the template.
  
-For example, for SNS themsadding ​the following 2 lines to the top of the template:+For example, for SNS themesadd the following 2 lines to the top of the template:
  
 <​code>​ <​code>​
Line 16: Line 20:
 </​code>​ </​code>​
  
-Similarly, for SM themes (such as sm-maxshop yttheme), ​adding ​the following to the top of the template:+Similarly, for SM themes (such as sm-maxshop yttheme), ​add the following to the top of the template: 
 <​code>​ <​code>​
 if (empty($var_yttheme)) { if (empty($var_yttheme)) {
Line 23: Line 28:
 </​code>​ </​code>​
  
-**Alternative Solution**: Remove footer block injection. Doing this will slow down page load times and increase cache size, and as such is not recommended.+==== 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/05/08 19:22
  • by Lisa Clarke