Jump to content

How can I add panel only to main homepage in whmcs


cumputerman

Recommended Posts

How can i add panel only to main homepage of my site https://www.seimaxim.com  Panel should be visible under domain search and above twitter feeds so visitors can see products I am offering on homepage. I have below hook but it is shown only after logging into client area. It does not show only on homepage as I want to do so.

<?php

use WHMCS\View\Menu\Item;

add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels)
{
    $thankYouMessage = <<<EOT
<p>Thanks for beta testing our latest offerings! To show our appreciation we'd
like to provide next month of service <strong>on the house</strong>.</p>
EOT;

    // Add a homepage panel with a link to a free month promo and mode it to the
    // front of the panel list.
    $homePagePanels->addChild('thanks', array(
        'label' => 'Thanks for the help!',
        'icon' => 'fa-thumbs-up',
        'order' => 20,
        'extras' => array(
            'color' => 'gold',
            'btn-link' => 'https://example.org/free-month-promo',
            'btn-text' => 'Redeem Your Free Month',
            'btn-icon' => 'fa-arrow-right',
        ),
        'bodyHtml' => $thankYouMessage,
        'footerHtml' => 'Act fast! This offer expires soon!',
    ));
});
 

Link to comment
Share on other sites

11 hours ago, cumputerman said:

How can i add panel only to main homepage of my site https://www.seimaxim.com  Panel should be visible under domain search and above twitter feeds so visitors can see products I am offering on homepage. I have below hook but it is shown only after logging into client area. It does not show only on homepage as I want to do so.

a homepagepanel hook wouldn't work because, as you have found, it's only shown on the client's homepage when they're logged in... not the generic homepage.

when you say panel, what exactly do you mean?

the simplest solution might just be to edit homepage.tpl - that's the page that shows the tweets, so you could put your 'panel' above that code (html or whatever, won't necessarily be a hook) and it will be shown where you want.

if you want to add something between the domain search and the 'how can we help you today?' buttons, then that's within header.tpl

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