championc Posted April 18, 2019 Share Posted April 18, 2019 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 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted April 18, 2019 Share Posted April 18, 2019 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); } }); 0 Quote Link to comment Share on other sites More sharing options...
championc Posted April 19, 2019 Author Share Posted April 19, 2019 Many thanks @steven99 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 19, 2019 Share Posted April 19, 2019 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')) 0 Quote Link to comment Share on other sites More sharing options...
championc Posted April 19, 2019 Author Share Posted April 19, 2019 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. Could I possibly change the "Powered by WHMCompleteSolution" or add the type of link I want under it ? It's only on this page that I would look to implement it. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 20, 2019 Share Posted April 20, 2019 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! 😲 0 Quote Link to comment Share on other sites More sharing options...
championc Posted April 22, 2019 Author Share Posted April 22, 2019 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 22, 2019 Share Posted April 22, 2019 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. 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.