Jump to content

Adding a "Contact Us" link to clientregister.tpl


championc

Recommended Posts

Hi all,

What would be the best way to add a "Contact Us" link on clientregister.pl, which creates a link to contact.php.  I want this because I have purposely hidden the menu bar until someone successfully logs on, so I want to give someone the ability to contact us without registering.

Thanks in advance  

Link to comment
Share on other sites

Two methods depending on what you want.  You can edit the template you mentioned and place the link where you want but then that needs to be done for any updates. 

The other method is to use hooks such as:

<?php

use WHMCS\View\Menu\Item as MenuItem;
add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar)

{
        if (!is_null($primarySidebar->getChild('Already Registered'))) {
                $primarySidebar->getChild('Already Registered')
        ->addChild('Contact Us')
                ->setLabel('Contact Us')
                ->setUri('contact.php')
                ->setOrder(100);
        }
});

 

Link to comment
Share on other sites

10 hours ago, steven99 said:

The other method is to use hooks such as:

if I were being picky... but it's Easter so i'll try not to be... 🍫

if the label is the same as the child name, there's no real need to set it - because if the label doesn't exist, the sidebar will use the child name anyway...

for it to be in the client's language, it should really have used...

->setLabel(Lang::trans('Contact Us'))
Link to comment
Share on other sites

15 hours ago, championc said:

Sorry folks but I got it wrong.  I'm looking to put a "<a href="contact.php">Contact Us</a>" type link on clientarea.php.

a screenshot of your site, showing where this link should be, would be helpful - depending on where you want to do it, it might need a hook or a template edit...

16 hours ago, championc said:

Could I possibly change the "Powered by WHMCompleteSolution"

if you could, it would defeat the need to buy unbranded licenses! 😲

Link to comment
Share on other sites

On 4/20/2019 at 12:20 PM, brian! said:

a screenshot of your site, showing where this link should be, would be helpful - depending on where you want to do it, it might need a hook or a template edit...

PM sent with website name.  Basically though, the screen is blank, with just the website name in the top left and the Language, Login, Register and View Cart in the top right, and the Login Section in the middle of the screen.

Link to comment
Share on other sites

if it's going to be along the top (in the language/login etc part), then that's a edit in the header.tpl template and you can add your code as above there;

if it's in the footer, then that's either an edit to footer.tpl (code as above), or you could use a footer output hook to do the same.

one other thought - are you using a hook that forces everyone to login to view any page, e.g cart/kb/announcements etc ?? if so, it's affecting contact.php too, so you'll have to alter that after you add a link to the contact page.

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