AbanteCart Community
AbanteCart Development => Extensions and Add-Ons => Topic started by: Bard00k on July 15, 2016, 04:10:51 PM
-
Hello everyone,
I'm trying to build an extension that includes an admin dashboard page and have its own button on the left navbar.
I tried the following code in my installation script (php):
$menu = new AMenu ( "admin" );
$menu->insertMenuItem ( array ( "item_id" => "extension_id",
"parent_id" => null,
"item_text" => "Extension Name",
"item_url" => "extension_unique_name",
"item_type"=>"core",
"sort_order"=>"0")
);
$data = array('language_id' => 0,
'section' => 1,
'block' => 'common/header',
'language_key' => 'extension_id',
'language_value' => 'Extension Name');
And it creates a menu like expected. However, now I want to set an icon instead of the default triangle.
I looked at the code and it expects a 'item_icon_rl_id' key, but I couldn't find in the doc what kind of value this param accept and where can I find a list of possible icon options?
Thanks! :)
-
Replying self:
// add new menu item
$rm = new AResourceManager();
$rm->setType('image');
// create resource for the menu icon
$data = array();
$data['resource_code'] = '<i class="fa fa-signal"></i> ';
$data['name'] = array($language_id => 'Menu Icon MenuName');
$data['title'] = array($language_id => '');
$data['description'] = array($language_id => '');
$resource_menu_icon_id = $rm->addResource($data);
And then using $resource_menu_icon_id works.
-
Thank you for update with solution :D