Ok a bit of an update…
I worked out how to add an icon - and adding it also resized the button to match the others too. NOTE: This is a bit of a hack, and a temporary one at that. If you ever need to change the menu app or re-gen it, then you will need to repeat these steps AFTER the re-gen because the “icon” key will be emptied again. I am hopeful that NetMake will add something to allow this to be set somewhere so this won’t be necessary.
To actually manually add an icon to the Help menu button you need to get the icon you need into the project and then edit the menu app’s index.php file.
Anyway it’s pretty simple to do:
First you will need to ensure the icon you want to use is available to your project. An easy way to do this is to add a menu item at the end of your list of other menu items - choose the icon you will want and assign it to that menu item. Note or copy the entry SC puts in the text box for that icon (e.g. scriptcase__NM__ico__NM__help2_16.png). You’ll need this later.
DO NOT provide a link to an app for this item - leave it blank. Then re-gen the app. This will add that new item and the icon into your project - however as there is no link to an app for it, it will not appear on your menu. You only need to do this bit once. You can delete it afterwards if you want as the re-gen will have done what we needed - which was to add the icon into the project. It can now be referenced elsewhere.
So, to the generated index.php. Around line 1400 (this will vary depending on how many other menu items you have) is the code where the elements of the Helpcase help button are assigned. You’ll notice the icon “key” is empty - something like:
if (is_file("menu_help.txt"))
{
$Arq_WebHelp = file("menu_help.txt");
if (isset($Arq_WebHelp[0]) && !empty($Arq_WebHelp[0]))
{
$Arq_WebHelp[0] = str_replace("
" , "", trim($Arq_WebHelp[0]));
$Tmp = explode(";", $Arq_WebHelp[0]);
foreach ($Tmp as $Cada_help)
{
$Tmp1 = explode(":", $Cada_help);
if (!empty($Tmp1[0]) && isset($Tmp1[1]) && !empty($Tmp1[1]) && $Tmp1[0] == "menu" && is_file($str_root . $path_help . $Tmp1[1]))
{
$menu_menuData['data'][] = array(
'label' => "" . $this->Nm_lang['lang_btns_help_hint'] . "",
'level' => "0",
'link' => "" . $path_help . $Tmp1[1] . "",
'hint' => "" . $this->Nm_lang['lang_btns_help_hint'] . "",
'id' => "item_Help",
[B]'icon' => "",[/B]
'target' => "" . $this->menu_target('_blank') . "",
'sc_id' => "item_Help",
'disabled' => "N",
);
}
}
}
}
Edit the line so it has the icon name you noted earlier:
[B]'icon' => "scriptcase__NM__ico__NM__help2_16.png",[/B]
Save the file and that’s it. Remember though, it will revert to “” if the app is re-genned.
