So we all know the Blesta navigation is amazing, it contains all the Blesta links and can be now customisable from the Admin area in 5.x.x.

This means you could use that instead of the BlestaCMS Navigation however, we designed ours so it was used for the theme / template navigation and we can keep the Blesta navigation for what it does best.

However there's times where we don't want to show the Blesta navigation like on our home page, our content pages and we want it just on the client area and order forms etc.

To do this wrap the Blesta navigation around this php code:

<?php if (strpos($_SERVER['REQUEST_URI'], "client") && $page_title != "Log In" && $page_title != "Reset Password" && $page_title != "Forgot Username" && $page_title != "Forgot Username" || strpos($_SERVER['REQUEST_URI'], "plugin")  || strpos($_SERVER['REQUEST_URI'], "order") !== false){ ?>

<?php } ?>
This hides the Blesta navigation or content and only shows it on /client/ /order/ and the pages with the above titles like Log In, Reset Password, etc.

For example the full navigation for Blesta will look like:

<?php if (strpos($_SERVER['REQUEST_URI'], "client") && $page_title != "Log In" && $page_title != "Reset Password" && $page_title != "Forgot Username" && $page_title != "Forgot Username" || strpos($_SERVER['REQUEST_URI'], "plugin")  || strpos($_SERVER['REQUEST_URI'], "order") !== false){ ?>
        <div class="nav-content">
            <nav class="navbar navbar-expand-md navbar-dark">
                <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#main-navbar">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <div class="collapse navbar-collapse pb-2 pb-md-0" id="main-navbar">
                    <div class="container-md flex-column flex-md-row align-items-start">
                        <?php
                        $active_nav = null;
                        ?>
                        <ul class="navbar-nav">
                            <?php
                            foreach ($this->Html->ifSet($nav, []) as $link => $value) {
                                $attributes = ['class' => ['nav-item']];
                                $link_attributes = ['class' => ['nav-link']];
                                $dropdown = !empty($value['sub']);
                                $active = false;

                                if ($value['active']) {
                                    $active = true;
                                    $attributes['class'][] = 'active';
                                    $active_nav = $value;
                                }
                                if ($dropdown) {
                                    $attributes['class'][] = 'dropdown';
                                    $link_attributes['class'][] = 'dropdown-toggle';
                                    $link_attributes['data-toggle'][] = 'dropdown';

                                    // Set parent to active if child is
                                    if (!$active) {
                                        foreach ($this->Html->ifSet($value['sub'], []) as $sub_link => $sub_value) {
                                            if ($sub_value['active']) {
                                                $attributes['class'][] = 'active';
                                                break;
                                            }
                                        }
                                    }
                                }
                            ?>
                            <li<?php echo $this->Html->buildAttributes($attributes);?>>
                                <a href="<?php $this->Html->_($link);?>"<?php echo $this->Html->buildAttributes($link_attributes);?>>
                                    <i class="<?php $this->Html->_($value['icon']);?>"></i>
                                    <?php
                                    $this->Html->_($value['name']);
                                    ?>
                                </a>
                                <?php
                                if (!empty($value['sub'])) {
                                ?>
                                <div class="dropdown-menu">
                                    <?php
                                    foreach ($this->Html->ifSet($value['sub'], []) as $sub_link => $sub_value) {
                                    ?>
                                    <a class="dropdown-item" href="<?php $this->Html->_($sub_link);?>"><i class="<?php $this->Html->_($sub_value['icon']);?>"></i> <?php $this->Html->_($sub_value['name']);?></a>
                                    <?php
                                    }
                                    ?>
                                </div>
                                <?php
                                }
                                ?>
                            </li>
                            <?php
                            }
                            ?>
                        </ul>
                        <ul class="navbar-nav">
                            <?php
                            if ($this->Html->ifSet($logged_in)) {
                            ?>
                            <li class="nav-item dropdown">
                                <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">
                                    <?php $this->Html->_($contact->first_name);?> <?php $this->Html->_($contact->last_name);?>
                                    <b class="caret"></b>
                                </a>
                                <div class="dropdown-menu">
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'main/edit/');?>"><i class="fas fa-edit fa-fw"></i> <?php $this->_('AppController.client_structure.text_update_account');?></a>
                                    <?php
                                    if ($this->Html->ifSet($has_email_permission)) {
                                    ?>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'emails/');?>"><i class="fas fa-inbox fa-fw"></i> <?php $this->_('AppController.client_structure.text_emails');?></a>
                                    <?php
                                    }

                                    if ($this->Html->ifSet($portal_installed, false)) {
                                    ?>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe(WEBDIR);?>"><i class="far fa-circle fa-fw"></i> <?php $this->_('AppController.client_structure.text_return_to_portal');?></a>
                                    <?php
                                    }
                                    ?>
                                    <div class="dropdown-divider"></div>
                                    <a class="dropdown-item" href="<?php echo $this->Html->safe($this->client_uri . 'logout/');?>"><i class="fas fa-sign-out-alt fa-fw"></i> <?php $this->_('AppController.client_structure.text_logout');?></a>
                                </div>
                            </li>
                            <?php
                            } else {
                            ?>
                            <li class="nav-item">
                                <a class="nav-link" href="<?php echo $this->Html->safe($this->client_uri . 'login/');?>">
                                    <?php $this->_('AppController.client_structure.text_login');?>
                                </a>
                            </li>
                            <?php
                            }
                            ?>
                        </ul>
                    </div>
                </div>
            </nav>
        </div>
      <?php } ?>