robetus Posted January 8, 2018 Share Posted January 8, 2018 I need to change or remove the title of a page for a tpl file inside a custom module. The link to the page looks like this: /clientarea.php?action=productdetails&id=23&modop=custom&a=modulepage I tried using the following inside the header.tpl file but it doesn't work (modulepage is the name of the tpl file): {if $templatefile neq 'modulepage'} {include file="$template/includes/pageheader.tpl" title=$displayTitle desc=$tagline showbreadcrumb=true} {/if} Anyone have any ideas on how I can get this to work? I would like to use a custom title for each of the module's tpl files. Right now I have "Manage Product" for the title which isn't suiting. Link to comment Share on other sites More sharing options...
sentq Posted January 9, 2018 Share Posted January 9, 2018 instead of editing your template files, the same goal could be achived using ActionHooks, create new PHP file inside /includes/hooks/ directory and place the following code inside it add_hook("ClientAreaProductDetailsPreModuleTemplate", 1, function($vars){ if ($_REQUEST['a'] == "modulepage"){ return array("displayTitle" => "Custom Title"); } }); 1 Link to comment Share on other sites More sharing options...
robetus Posted January 9, 2018 Author Share Posted January 9, 2018 Worked great, thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts