AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: jaysbar on September 16, 2016, 11:36:58 AM

Title: How to add menu on the Admin page?
Post by: jaysbar on September 16, 2016, 11:36:58 AM
Hi

Is it possible to edit the Admin page? I want to add a new menu item which is basically a hyperlink which should display as a frame on the right of the menu. For example, if the menu item says Links and I click, it should expand and show me Links. If one of the links is www.google.com and I click it, it should open www.google.com in the main admin window.

Make sense?

Thanks

Jay
Title: Re: Can I edit Links and Layout of the Admin page?
Post by: abantecart on September 17, 2016, 11:50:19 AM
Check core banner manager extension as example on how to add new menu.

https://github.com/abantecart/abantecart-src/blob/master/public_html/extensions/banner_manager/install.php

Code: [Select]
$rm = new AResourceManager();
$rm->setType('image');
$language_id = $this->language->getContentLanguageID();
$data = array();
$data['resource_code'] = '<i class="fa fa-picture-o"></i>&nbsp;';
$data['name'] = array($language_id => 'Menu Icon Banner Manager');
$data['title'] = array($language_id => '');
$data['description'] = array($language_id => '');
$resource_id = $rm->addResource($data);
$menu = new AMenu ( "admin" );
$menu->insertMenuItem ( array (  "item_id" => "banner_manager",
"parent_id"=>"design",
"item_text" => "banner_manager_name",
"item_url" => "extension/banner_manager",
"item_icon_rl_id" => $resource_id,
"item_type"=>"extension",
"sort_order"=>"6")
);

Do not forget to clear cache after update
Title: Re: How to add menu on the Admin page?
Post by: jaysbar on September 23, 2016, 07:13:52 AM
Hi

I got really stuck with this! I thought it may have been simpler as I just want to add a link to Google Analytics to my admin page.

I came across this post: http://forum.abantecart.com/index.php/topic,1102.msg4270.html#msg4270

Will this work on 1.2.8?

INSERT INTO `abc_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES (7,'external_links',11)

--ITEM_TEXT
INSERT INTO `abc_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES (8,'text_external_links',11)

--ITEM_URL
INSERT INTO `abc_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES (9, 'https://analytics.google.com/analytics' ,11)

--PARENT_ID
INSERT INTO `abc_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES  (10,'external_links',11)

--SORT_ORDER
INSERT INTO `abc_dataset_values` (`dataset_column_id`, `value_integer`,`row_id`)
VALUES  (11,1,11)

--ITEM_TYPE
INSERT INTO `abc_dataset_values` (`dataset_column_id`, `value_varchar`,`row_id`)
VALUES  (12,'core',11)

-----
EDIT - I added the above lines to my DB. Please see attachments for the results - the menu text is missing and link does not work.
Title: Re: How to add menu on the Admin page?
Post by: jaysbar on September 26, 2016, 10:26:35 AM
Can someone please help me with this??
Title: Re: How to add menu on the Admin page?
Post by: eCommerce Core on September 26, 2016, 11:04:16 AM
Did you clear cache?

Since you use text_external_links, did you create this language definition entry?
->> VALUES (8,'text_external_links',11)

For everybody new, I would suggest using PHP method as it is much easier.
Title: Re: How to add menu on the Admin page?
Post by: jaysbar on September 26, 2016, 12:07:55 PM
Hi

I will follow whatever is the easiest option! But I am not a developer so need some help!

It's easy for me to create the install.php file. But I don't understand what to do next.

Also, I can see how to add a new Language Definition, but what shall I enter for Value and Key? When I Inspect Code for text_external_links it shows <span class="menu_text"></span>. But it should say <span class="menu_text">Links</span>.

PLEASE can someone help!!