Jump to content

Help with Hook not completely removing sidebar


MistaMista

Recommended Posts

Hi,

I need some help completely removing a sidebar from the client area.

I'm using a Hook to remove the sidebar, however I'm always left with this empty div, specifically the <div class="col-mi-3 pull-md-left sidebar">. It ends up looking like this.  https://prnt.sc/2359cs7

This is the hook I'm using:

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $secondarySidebar)
{
    if (!is_null($secondarySidebar->getChild('Ticket List Status Filter'))) {
        $secondarySidebar->removeChild('Ticket List Status Filter');
    }    
});

Am I doing something wrong with the hook, or is it possibly just an issue in my style-sheet?

Thanks

 

Link to comment
Share on other sites

For anyone running into a similar issue I found the solution here:

 

 

I ended up editing this div in my themes header.tpl file with the code brian! had provided in that post.

It now looks like this.

{if $templatefile neq "clientareainvoices"}
                <div class="col-mi{if $secondarySidebar|@count gt 0}9{else}12{/if} pull-md-left sidebar">
                    {include file="$template/includes/sidebar.tpl" sidebar=$primarySidebar}
                </div>
            {/if}

This is now having the desired effect of completely removing the empty div and and the remaining content is no longer floating in space over of the right side of the 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