rob2 Posted April 8, 2016 Share Posted April 8, 2016 Hi, mainly,i do not want to show the fulname, so,i think to replace them as one message directly, i search and find the hook <?phpuse WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPage', 1, function ($vars) { if($vars['templatefile'] == 'clientareahome'){ $vars['displayTitle'] = 'new welcome message'; } // If you want to use client's details, use $vars['clientsdetails'] return $vars; }); but when i use,my certain addon can not show well on the clientarea.php, i want to ask if any way to let me modify the welcome message well ? thank you. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 8, 2016 Share Posted April 8, 2016 (edited) Hi Rob, the following should work.. <?php add_hook('ClientAreaPageHome', 1, function ($vars) { $vars['displayTitle'] = 'Welcome back!'; return $vars; }); if you wanted to make it multilingual and use the language string to display "Welcome Back" in the client's language... <?php add_hook('ClientAreaPageHome', 1, function ($vars) { $vars['displayTitle'] = Lang::trans('welcomeback'); return $vars; }); if you want every client to see the same message, use the first hook; if you want them to see a message in their own language, use the second hook. if you want to modify the "Welcome Back" string for each language, use Language Overrides. http://docs.whmcs.com/Language_Overrides alternatively, you could have modified the includes/pageheder.tpl template instead of using a hook... {if $title|strstr:$LANG.welcomeback} {assign "title" "alternative message"} {/if} <div class="header-lined"> <h1>{$title}{if $desc} <small>{$desc}</small>{/if}</h1> {if $showbreadcrumb}{include file="$template/includes/breadcrumb.tpl"}{/if} </div> Edited April 8, 2016 by brian! 0 Quote Link to comment Share on other sites More sharing options...
rob2 Posted April 8, 2016 Author Share Posted April 8, 2016 Hi, it seems the hook method still make my addon can not show well, finally,i use your way to replace the .tpl file to modify it. thank you again. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.