Greeting,

I tried adding a new menu called "Info", by adding this code on class.nav.php on line 352:

$navs['info']=array('desc'=>__('Info'),'href'=>'test.php','title'=>'');

that Info menu directed to blank page:

<?php
require('client.inc.php');
require_once INCLUDE_DIR . 'class.page.php';
$section = 'informasi';
require(CLIENTINC_DIR.'header.inc.php');
?>
<div id="landing_page">
<div class="container">
<div class="row">
</div>
</div>
</div>
<?php //include CLIENTINC_DIR.'templates/sidebar.tmpl.php'; ?>
<div class="clear"></div>
<?php require(CLIENTINC_DIR.'footer.inc.php'); ?>

The problem is when i clicked Info Menu, Home Menu got active, not Info Menu just like the picture attached.

What did i do wrong? Please help. (Sorry for my bad english)

7 days later

So you have created a test.php.
I guess that you have added a hyperlink in the navigation menu at the header
and when you click the info it takes you to the home page rather than the info test page.

Am I right? Try this below in header.inc.php in include / client folder and see if this works.
Just Add before the </ul> the <li><a href="/test.php">info</a></li>

    <ul id="nav" class="flush-left">
        <?php
        if($nav && ($navs=$nav->getNavLinks()) && is_array($navs)){
            foreach($navs as $name =>$nav) {
                echo sprintf('<li><a class="%s %s" href="%s">%s</a></li>%s',$nav['active']?'active':'',$name,(ROOT_PATH.$nav['href']),$nav['desc'],"\n");
            }
        } ?>
    <li><a href="/test.php">Info</a> </li>
    </ul>

osTicket uses a CMS system in menu, find it in pages, that you can use also and create multiple pages on the go.

4 days later

No. When i click the info, it takes me to test page, but the highlighted menu is home, not info. I tried your solution by adding <li><a href="/test.php">info</a></li>, but it didn't work. Thanks for your response.

Write a Reply...