Hi, i wondered if it is possible to add a custom menu link that is project specific?
I've had a look around and I can see there seems to be a $g_main_menu_custom_options option but I assume that is global, and I want to add some project specific links
any help would be appreciated
Add a project specific custom menu link
Moderators: Developer, Contributor
Re: Add a project specific custom menu link
There is a function helper_get_current_project that returns the current project id.
You can set $g_main_menu_custom_options depending on the return value of the function.
You can set $g_main_menu_custom_options depending on the return value of the function.
Re: Add a project specific custom menu link
interesting, I didn't know that. How would I go about this, do I still need to add $g_main_menu_custom_options via config or can I do this via the config options on the admin cp?atrol wrote:There is a function helper_get_current_project that returns the current project id.
You can set $g_main_menu_custom_options depending on the return value of the function.
Re: Add a project specific custom menu link
okay thanks. Is there an example on how to use this? eg only show this menu if project id = 3atrol wrote:You have to implement it in config_inc.php
Edit; Managed to figure it out, thanks
Re: Add a project specific custom menu link
I am not able to do that... Can you assist me for adding custom menu link specific to project
Thanks
Thanks
Re: Add a project specific custom menu link
In config_inc I am doing this
if (helper_get_current_project() == 1)
{
$g_main_menu_custom_options = array( array(
'title' => 'Staging',
'access_level' => 'NOBODY',
'url' => 'https://test.com',
'icon' => 'fa-plug'), );
};
if (helper_get_current_project() == 1)
{
$g_main_menu_custom_options = array( array(
'title' => 'Staging',
'access_level' => 'NOBODY',
'url' => 'https://test.com',
'icon' => 'fa-plug'), );
};