News:

AbanteCart v1.4.2 is released.

Main Menu
support

How to add menu on the Admin page?

Started by jaysbar, September 16, 2016, 11:36:58 AM

Previous topic - Next topic

jaysbar

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

abantecart

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


$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
Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

jaysbar

#2
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.

jaysbar


eCommerce Core

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.
"If you're in the luckiest one per cent of humanity, you owe it to the rest of humanity to think about the other 99 per cent."
― Warren Buffett

jaysbar

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!!


Forum Rules Code of conduct
AbanteCart.com 2010 -