Jump to content

Show Sidebar on a Addon Module Page


hosttech

Recommended Posts

Hey folks

I'm trying to display a sidebar on a custom addon module page. It seems like the template used does not even support a sidebar on that page. But I cannot figure out what's wrong with it.

Basically, I'm extending domain functionality. So I'd like to display the Domain sidebar.

I've done this:

URL for custom page: 

index.php?m=MODULENAME

My Hook:

add_hook('ClientAreaPrimarySidebar', 1, function ($menu) {

    if(!empty($_GET['domainid'])){
        $domainid = $_GET['domainid'];
    }else{
        $domainid = $_GET['id'];
    }

    if ($_REQUEST['m'] === 'MODULENAME'){

        $clientid = $_SESSION['uid'];

        $client = Client::find($clientid);

        $domain = Domain::where('id', $domainid)->get()->first();

        Menu::addContext('client', $client);
        Menu::addContext('domain', $domain);
        $menu = Menu::primarySidebar('domainView');
    }
});

var_dump'ing the $menu even gives the correct structure. So the Sidebar is perfectly fine. But it is not rendered. What am I missing?

 

Thank you in advance!

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