Jump to content

how to make menu item not collapsed


Recommended Posts

yes, that is a sidebar

this is the html section

<a role="button" data-toggle="collapse" data-parent="#wdesaccordion" href="#Primary_Navbar-Store" aria-expanded="false" aria-controls="Primary_Navbar-Store" class="fal fa-shopping-cart menu-icon-new">Oferta<span class="fal fa-angle-down"></span></a>

this is the header.tpl file

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="{$charset}" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{if $kbarticle.title}{$kbarticle.title} - {/if}{$pagetitle} - {$companyname}</title>

  {include file="$template/includes/head.tpl"} {$headoutput}

</head>

<body class="body" data-phone-cc-input="{$phoneNumberInputStyle}">

  {$headeroutput}

  <!-- Loading -->
  <div class="wdes-loading">
    <div class="wdes-loader wdes-loader-icon">
      <div class="line line1"></div>
      <div class="line line2"></div>
      <div class="line line3"></div>

    </div>

  </div>

  <div class="wdes-wrapper">
	  	<div id='stars'></div>
  <div id='stars2'></div>
  <div id='stars3'></div>
    {if ($templatefile ne 'login') && ($templatefile ne 'clientregister')}
    <!-- Wdes SideBar -->
    {include file="$template/wdes/wdes-sidebar.tpl"}
    <!-- WHMCS Sidebar -->
    {if ($primarySidebar->hasChildren() || $secondarySidebar->hasChildren()) && $templatefile ne 'configureproductdomain' && $templatefile ne 'configureproduct' && $templatefile ne 'viewcart'}
    <div class="whm-sidebar">
      {include file="$template/includes/sidebar.tpl" sidebar=$primarySidebar} {include file="$template/includes/sidebar.tpl" sidebar=$secondarySidebar}
    </div>
    {/if}
    {/if}
    <!-- Wdes Content -->
    <div class="wdes-content">
      <!-- Header -->

      <section id="header">
        <div class="container">
          <ul class="top-nav">
            <!-- Language -->
            {if $languagechangeenabled && count($locales) > 1}
            <li class="wdes-language-item">
              <a href="#" class="choose-language" data-toggle="popover" id="languageChooser">
                <span class="fal fa-language"></span>
              </a>
              <div id="languageChooserContent" class="hidden">
                <ul>
                  {foreach $locales as $locale}
                  <li>
                    <a href="{$currentpagelinkback}language={$locale.language}">{$locale.localisedName}</a>
                  </li>
                  {/foreach}
                </ul>
              </div>
            </li>
            {/if}
          </ul>
          <!-- Logo -->
          <a href="{$WEB_ROOT}/index.php" class="logo">
            <img src="{$WEB_ROOT}/templates/{$template}/img/theme-dark-logo.png" alt="{$companyname}">
          </a>
        </div>
      </section>

      <section class="col-md-12" id="main-body">
	  
        {include file="$template/includes/verifyemail.tpl"}
        <div class="container{if $skipMainBodyContainer}-fluid without-padding{/if}">
          <div class="row">
            {if !$inShoppingCart && ($primarySidebar->hasChildren() || $secondarySidebar->hasChildren())} {if $primarySidebar->hasChildren()
            && !$skipMainBodyContainer}
            <div class="col-md-12">
              {include file="$template/includes/pageheader.tpl" showbreadcrumb=true desc=$tagline}
            </div>
            {/if} {/if}
            <!-- Container for main page display content -->
            <div class="{if !$inShoppingCart && ($primarySidebar->hasChildren() || $secondarySidebar->hasChildren())}col-md-12{else}col-xs-12{/if} main-content">
              {if !$primarySidebar->hasChildren() && !$showingLoginPage && !$inShoppingCart && $templatefile != 'homepage' && !$skipMainBodyContainer}
              {include file="$template/includes/pageheader.tpl" showbreadcrumb=true desc=$tagline} {/if}

 

Link to comment
Share on other sites

Everything is right with your tip and code. But I only want to change the style of my current shop category, excatly I want to make the categories be uncollapse. I don't know how to say it.

It have to be just like delete the..

data-toggle="collapse"

.. from the button which is Store menu item.

And with this also remove the mark point which is on the right side of this menu item.

 

I hope you can understand me..

 

 

Link to comment
Share on other sites

6 hours ago, rottenteeth said:

I hope you can understand me..

I think so, i'm trying to. 🙂

6 hours ago, rottenteeth said:

And with this also remove the mark point which is on the right side of this menu item.

what i'm assuming that you want to do is...

  1. do not show product groups in that menu (Hosting WWW, Hosting Reseller etc).
  2. minimise that menu content (e.g collapse it).
  3. remove the ^

and what you really want is just a "Store" link on that menu that goes to cart.php (or wherever).

if that's the case, I think your menu is really a vertical navbar rather than a sidebar... and if that's the case, then the navbar hook below should remove the store link (and all the product groups inside it), and add a new 'Store' link that goes to the cart.php page.

<?php

# Remove Store From Navbar Hook
# Written by brian!

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
	if (!is_null($primaryNavbar->getChild('Store'))) {
		$primaryNavbar->removeChild('Store');
		$primaryNavbar->addChild('Store2', array('label' => Lang::trans('navStore'),'uri' => 'cart.php','order'	=> 10,));
	}
});

using the Six template, then it would change the first image to the second....

OpZmgOV.png

jhitcs5.png

however, from that code, I think you are using the Digit theme - it should work with that template too.

spbj1BU.png

Link to comment
Share on other sites

So.. not excatly like this way.. this code just make another single menu item..

I want to make this like this.

Before
I have Store with dropdown elements

<a role="button" data-toggle="collapse" data-parent="#wdesaccordion" href="#Primary_Navbar-Store" aria-expanded="false" aria-controls="Primary_Navbar-Store" class="fal fa-shopping-cart menu-icon-new">
  Store
  <span class="fal fa-angle-down"></span>
</a>

After 
I have also the same Store menu item but without option to collapse and always stay uncollapsed.

- remove data-toggle="collapse"

- remove <span class="fal fa-angle-down"></span>

<a role="button" data-parent="#wdesaccordion" href="#Primary_Navbar-Store" aria-expanded="false" aria-controls="Primary_Navbar-Store" class="fal fa-shopping-cart menu-icon-new">
  Store
</a>

It would be presented like this

image.png.dd02caaaf49ebe9aa3025bfc563bdf71.png

Is this possible to do with hooks or something else?

Edited by rottenteeth
Link to comment
Share on other sites

45 minutes ago, rottenteeth said:

- remove data-toggle="collapse"

- remove <span class="fal fa-angle-down"></span>

they will both be being added automatically by navbar.tpl or whatever the equivalent is in Digit.

if the menu auto opens, then you might be able to get away with using CSS to hide the span within the <a> link... but equally if it's only 5 links, you could add them manually with a hook, or loop through the available product groups and output them.

for specific Digit advice, you really should contact the developer - assuming that you have bought the theme. 🙂

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