Jump to content

Welcome Back fulname on clientarea.php


rob2

Recommended Posts

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

 

 

<?php

use 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.

Link to comment
Share on other sites

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. :idea:

 

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 by brian!
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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