Edit Emoncms navigation bar

Hi,

I have a Debian server with ip 192.168.4.2 on which run emoncms and another web app.

I would need to make a change to the navigation bar of emoncms.

I would add an additional link next to Extra pointing to http://192.168.4.2/otherwebapp

The code should be like this :

<li class=" menu-right"><a href="http://192.168.4.2/otherwebapp">
    <div style="display: inline">
    <i class="icon-home icon-white" title="Home"></i> 
    <span class="menu-text">Home</span>
    </div>
</a>
</li>

And this is the result:

How and where do I put the code for this configuration ?

Thank you so much.

A.

I believe in this file menu_view.php here would be the best place:

https://github.com/emoncms/emoncms/blob/master/Theme/basic/menu_view.php

I’ve not tested this

Hi,

I removed the comment from the code you posted and modified for my needs.

Almost perfect!

Here it is:

// Example how to add a fixed menu item:
    $menu['right'][] = array(
    'name'=>'Home', 
    'icon'=>'icon-home icon-white', 
    'path'=>"redirect_home.php", 
    'session'=>"write", 
    'order' => 60,
    'divider' => true);

The only problem is that the default path is already 192.168.4.2/emoncms.
So I added a redirect.php in emoncms folder pointing at 192.168.4.2/home.

For the moment it works fine.

Thanks so much!

A.

1 Like