Jump to content

Custom Pagetitle for custom module page


robetus

Recommended Posts

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

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");
    
    }
    
});

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated