Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
litespeed_wiki:cache:lscps:customization_1_7 [2018/02/05 21:36]
Lisa Clarke Proofreading
litespeed_wiki:cache:lscps:customization_1_7 [2018/02/05 21:57]
Jackson Zhang [Make changes to template]
Line 3: Line 3:
 PrestaShop v1.7 [[http://​developers.prestashop.com/​themes/​smarty/​helpers.html#​widgets|introduces]] ''​{widget}''​ and ''​{widget_block}''​ elements that can be used in Smarty templates directly. PrestaShop v1.7 [[http://​developers.prestashop.com/​themes/​smarty/​helpers.html#​widgets|introduces]] ''​{widget}''​ and ''​{widget_block}''​ elements that can be used in Smarty templates directly.
  
-To ensure a hole is punched for a widget, you must define it as an ESI block. Currently, this can not be automated. You will have to manually place LSCache hooks to mark the beginning and the end of each ESI block in the template. LSCache relies on these hooks to trigger the ESI injection. ​+To ensure a hole is punched for a widget, you must define it as an ESI block. Currently, this can not be automated. You will have to manually place LSCache hooks to mark the beginning and the end of each ESI block in the template. LSCache relies on these hooks to trigger the ESI injection.
  
-===== Cart and Login Widgets as ESI Blocks =====+It currently only impacts cart (ps_shoppingcart) and login (ps_customersignin) blocks at the time of this writing. 
 +===== Widgets as ESI Blocks =====
  
 The Cart (''​ps_shoppingcart''​) and Login (''​ps_customersignin''​) blocks already have hooks defined in the default “classic” template so there is no need to change template files for those particular blocks in that particular template. If ''​ps_shoppingcart''​ and ''​ps_customersignin''​ are not triggered through hooks, but through ''​{widget}''​ or ''​{widget_block}'',​ you //will// have to manually update the template file. The Cart (''​ps_shoppingcart''​) and Login (''​ps_customersignin''​) blocks already have hooks defined in the default “classic” template so there is no need to change template files for those particular blocks in that particular template. If ''​ps_shoppingcart''​ and ''​ps_customersignin''​ are not triggered through hooks, but through ''​{widget}''​ or ''​{widget_block}'',​ you //will// have to manually update the template file.
Line 117: Line 118:
 </​code>​ </​code>​
  
 +=== 4. ps_shoppingcart as widget ===
 +
 +Replace the following:
 +
 +<​code>​
 + {widget name="​ps_shoppingcart"​}
 +</​code>​
 +
 +with: 
 +<​code>​
 + {hook h="​litespeedEsiBegin"​ m="​ps_shoppingcart"​ field="​widget"​}
 +        {widget name="​ps_shoppingcart"​}
 +        {hook h="​litespeedEsiEnd"​}
 +</​code>​
 ==== Make changes to multi-templates ==== ==== Make changes to multi-templates ====
 Sometime ''​header.tpl''​ located at ''​themes/​warehouse/​templates/​_partials/​header.tpl''​ may use various variants, such as the following: Sometime ''​header.tpl''​ located at ''​themes/​warehouse/​templates/​_partials/​header.tpl''​ may use various variants, such as the following:
  • Admin
  • Last modified: 2020/08/11 19:15
  • by Lisa Clarke