Author Topic: How to add menu on the Admin page?  (Read 4870 times)

Offline jaysbar

  • Full Member
  • ***
  • Posts: 139
  • Karma: +13/-5
    • View Profile
How to add menu on the Admin page?
« 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
« Last Edit: September 17, 2016, 11:51:21 AM by abantecart »

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4359
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Can I edit Links and Layout of the Admin page?
« Reply #1 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
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

Offline jaysbar

  • Full Member
  • ***
  • Posts: 139
  • Karma: +13/-5
    • View Profile
Re: How to add menu on the Admin page?
« Reply #2 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.
« Last Edit: September 23, 2016, 07:29:45 AM by jaysbar »

Offline jaysbar

  • Full Member
  • ***
  • Posts: 139
  • Karma: +13/-5
    • View Profile
Re: How to add menu on the Admin page?
« Reply #3 on: September 26, 2016, 10:26:35 AM »
Can someone please help me with this??

Offline eCommerce Core

  • Administrator
  • Hero Member
  • *****
  • Posts: 1602
  • Karma: +93/-1
    • View Profile
Re: How to add menu on the Admin page?
« Reply #4 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.
“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

Offline jaysbar

  • Full Member
  • ***
  • Posts: 139
  • Karma: +13/-5
    • View Profile
Re: How to add menu on the Admin page?
« Reply #5 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!!


 

Database Error

Please try again. If you come back to this error screen, report the error to an administrator.