ezpublish

override template in to ez publish 5, tpl file to twig


I need your help! I use ez publish 5 and need override template for forgotpasswordmail.tpl can anyone help? some examples code would be great for me.


Solution

  • Assuming you have a legacy extension created for your code and a legacy design active, the best practice would be to place the new template in your legacy extension with the same directory structure as the original one.

    The original file is placed in ezpublish_legacy/design/standard/templates/user/forgotpasswordmail.tpl, so you need to place yours in ezpublish_legacy/extension/my_extension/design/my_design/templates/user/forgotpasswordmail.tpl

    After clearing the legacy caches, eZ Publish 5 will pick up the new file automatically.

    If you do not have the design yet, to activate it, first you need to create a design.ini.append.php file in my_extension/settings folder with the following content:

    <?php /* #?ini charset="utf-8"?
    
    [ExtensionSettings]
    DesignExtensions[]=my_extension
    */ ?>
    

    This makes the extension a "design extension", meaning eZ Publish will look into the extension when searching for designs.

    Then you need to set your siteaccess to use the new design in ezpublish_legacy/settings/siteaccess/YOUR_SITEACCESS/site.ini.append.php and clear the caches:

    [DesignSettings]
    SiteDesign=my_design