Jump to content

1. How to completely hide sidebar 2. SecondarySidebar is not showing


Bjarn

Recommended Posts

Hello,

 

I'm currently working on creating my own theme for my WHMCS installation, but I am having issues with the sidebar.

 

First of all, I want to remove the complete sidebar from the Client homepage, so it's full width. I know how to remove sidebar childs, but I can't seem to find a way to completely remove the sidebar.

 

Also, my Secondary Sidebar is not showing which is very weird.

 

Thanks!

Link to comment
Share on other sites

I'm currently working on creating my own theme for my WHMCS installation, but I am having issues with the sidebar.

First of all, I want to remove the complete sidebar from the Client homepage, so it's full width. I know how to remove sidebar childs, but I can't seem to find a way to completely remove the sidebar.

you won't be able to do it entirely with hooks, you'll need to make template changes...

 

https://forum.whmcs.com/showthread.php?116654-Remove-Sidebar-from-product-detail-page&p=471806#post471806

 

e.g you could edit header.tpl and change the bottom block of code to...

 

<section id="main-body" class="container">

   <div class="row">
       {if !$inShoppingCart && ($primarySidebar->hasChildren() || $secondarySidebar->hasChildren()) && $templatefile neq 'clientareahome'}
           {if $primarySidebar->hasChildren()}
               <div class="col-md-9 pull-md-right">
                   {include file="$template/includes/pageheader.tpl" title=$displayTitle desc=$tagline showbreadcrumb=true}
               </div>
           {/if}
           <div class="col-md-3 pull-md-left sidebar">
               {include file="$template/includes/sidebar.tpl" sidebar=$primarySidebar}
           </div>
       {/if}
       <!-- Container for main page display content -->
       <div class="{if !$inShoppingCart && ($primarySidebar->hasChildren() || $secondarySidebar->hasChildren()) && $templatefile neq 'clientareahome'}col-md-9 pull-md-right{else}col-xs-12{/if} main-content">
           {if !$primarySidebar->hasChildren() && !$showingLoginPage && !$inShoppingCart && $templatefile != 'homepage' || $templatefile eq 'clientareahome'}
               {include file="$template/includes/pageheader.tpl" title=$displayTitle desc=$tagline showbreadcrumb=true}
           {/if}  

that would hide the primary sidebar from clientareahome and make the page full-width - the secondary sidebar would still be there, but you could either remove them from that specific page using an action hook, or modify sidebar,tpl with an opening {if} statement.

 

{if $templatefile neq 'clientareahome'}
.... rest of existing code
{/if}

 

Also, my Secondary Sidebar is not showing which is very weird.

on which page(s)? remember not all pages uses both primary and secondary sidebars.

Link to comment
Share on other sites

Hello,

 

Thanks for your response, awesome! :)

 

For the secondary sidebar, it's not working on any page. By example; it's not working on the homepage either. It is working the default six template but not for my own but even if I revert my changes it suddenly reappeared.

 

Also I can't seem to be able to find the difference between my template en the six template's header/head and pageheader files.

 

- - - Updated - - -

 

Hello,

 

Thanks for your response, awesome! :)

 

For the secondary sidebar, it's not working on any page. By example; it's not working on the homepage either. It is working the default six template but not for my own but even if I revert my changes it suddenly reappeared.

 

Also I can't seem to be able to find the difference between my template en the six template's header/head and pageheader files.

 

(Can't find the edit button?)

 

I found out that my template has no $secondarySidebar, seems like I was able to integrate it now but I can't find it in the six template either.

Link to comment
Share on other sites

Hi,

 

it's difficult to advise on this as obviously I don't know what you've changed in the code of your custom template... though the fact it reappeared after reverting the changes should give you a clue where to look, r.g go through the changes and see which step is causing the sidebar to disappear.

Link to comment
Share on other sites

I just duplicated the primarySidebar thing and changed it to secondarySidebar, but this wasn't in there on the six template, but whatever, it's working now :)

 

Also, do you know how I can translate dates in WHMCS 7.0.1? I can't find it in my lang file and the php option doesn't work.

Link to comment
Share on other sites

Also, do you know how I can translate dates in WHMCS 7.0.1? I can't find it in my lang file and the php option doesn't work.

when you say PHP option, which one are you referring to?

 

the language file isn't an option, so you're looking at modifying the date either by a Smarty replace, an action hook or by using setlocale in the configuration file... the last option is the more thorough solution.

 

https://forum.whmcs.com/showthread.php?98551-Announcements-timestamp-in-other-language

https://forum.whmcs.com/showthread.php?98194-Date-in-another-language

Link to comment
Share on other sites

when you say PHP option, which one are you referring to?

 

the language file isn't an option, so you're looking at modifying the date either by a Smarty replace, an action hook or by using setlocale in the configuration file... the last option is the more thorough solution.

 

https://forum.whmcs.com/showthread.php?98551-Announcements-timestamp-in-other-language

https://forum.whmcs.com/showthread.php?98194-Date-in-another-language

 

The configuration option was the one I meant haha, setLocale isn't working for me sadly (WHCMS 7.0.1)

Link to comment
Share on other sites

when you say PHP option, which one are you referring to?

 

the language file isn't an option, so you're looking at modifying the date either by a Smarty replace, an action hook or by using setlocale in the configuration file... the last option is the more thorough solution.

 

https://forum.whmcs.com/showthread.php?98551-Announcements-timestamp-in-other-language

https://forum.whmcs.com/showthread.php?98194-Date-in-another-language

 

I meant the configuration one indeed! The setLocale did work for the viewannouncement.tpl, but not for all the other pages by example; Ticket Overview etc.

Link to comment
Share on other sites

I think the problem is that PHP wouldn't see those dates as dates, just as text strings - therefore, it doesn't know to change them.

if you modified the Smarty code to use a specific date format, then setLocale will change it to your chosen language.

for example, if you take 'clientareadomains.tpl' and change...

 

<td><span class="hidden">{$domain.normalisedRegistrationDate}</span>{$domain.registrationdate}</td>

to...

<td><span class="hidden">{$domain.normalisedRegistrationDate}</span>{$domain.normalisedRegistrationDate|date_format:"%A, %B %e, %Y"}</td>

it now knows it's a date and changes the language.

 

SKcvUUU.png

 

it works on viewannouncement.tpl for exactly the same reason - the variable uses date_format to output the chosen date.

 

I don't think anyone's posted an action hook (or addon) that attempts to do this generally for all dates in WHMCS, so you may be looking at going through every date variable you want to change and tweaking it in a similar way - which would be a lengthy task and make updating more difficult. :roll:

 

it might just be easier to use a numeric date format for admin (e.g 01/11/2016) and set the clients to use the same format - that would avoid the need for these changes. :idea:

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