How to change default 'search' action in admin tab ?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

How to change default 'search' action in admin tab ?

Post by MikaelNazarenko » 30 Jun 2019, 07:28

Hello community! I need help.
I have added some new tab to my Laravel aimeos admin panel, like here laravel-package-f18/admin-dashboard-add ... html#p6043.
But I want to change default 'search' action 'admin/default/jqadm/search/profile?lang=en', as you may see here always 'search'.
I had a look at this file /var/www/labor/ext/ai-admin-jqadm/admin/jqadm/templates/common/page-standard.php and there seems it hardcoded, so I don't have idea how to change default action for my new admin tab.

Thank you!

Laravel Framework 5.8.26
aimeos-laravel 2019.04
PHP Version 7.2.19-1+ubuntu18.04.1+deb.sury.org+1

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: How to change default 'search' action in admin tab ?

Post by aimeos » 30 Jun 2019, 10:02

Yes, the "search" action is hard coded. What would you like to call instead? Isn't it possible to implement in your search method?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Re: How to change default 'search' action in admin tab ?

Post by MikaelNazarenko » 30 Jun 2019, 12:16

Thank you very much for response! I gonna to build shop system based on Laravel for my client, and now I must make decision which package should I use. I am learning aimeos. I need to customize admin panel a lot. I added new tab 'profile'. There user can change his data (only first name, last name and password). And there the action name as 'profile' or 'edit' would be more logical. 'Search' is not good.

But now I have one more problem. Before this moment I edited all files in this directory /var/www/labor/ext/ai-admin-jqadm. But just now I have created custom extension using Aimeos builder. I have added extension folder to .ext folder.
To add new tabs I edited this file /var/www/labor/ext/ai-admin-jqadm/admin/jqadm/config/admin/jqadm/navbar.php
But I want do all things using my custom extension folder. When I created extension I selected Aimeos 2019.x extension. But in extension folder I don't see navbar.php file. Can you, please, help me with it ?

I have copied this folder ext/ai-admin-jqadm/admin/jqadm/config/admin/jqadm to my extension folder and edited navbar.php in my ext folder. But it doesn't work, it works only if I delete this file ext/ai-admin-jqadm/admin/jqadm/config/admin/jqadm/navbar.php


Thank you very much!

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: How to change default 'search' action in admin tab ?

Post by aimeos » 30 Jun 2019, 20:41

You should only edit files in your own extenstion. Modifying the original files is prohibited!

If you add a configuration, it's merged with the existing configuration, so you can overwrite leaf settings but not complete arrays. That's only possible if you add the config to your ./config/shop.php file in your Laravel installation.

Regarding the default action, it might be possible to make it configurable.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Re: How to change default 'search' action in admin tab ?

Post by MikaelNazarenko » 01 Jul 2019, 07:43

Thank you very much for the help!
But can you, please, tell me what exactly should I add to ./config/shop.php ? I need to completely overwrite ext/ai-admin-jqadm/admin/jqadm/config/admin/jqadm/navbar.php with my own without merging. I am so sorry for a lot questions. I had a look into Aimeos documentation but have not found answer for my exact question. I need little help so then I can go ahead. Also I think it will be useful for other customers.

Maybe you also may give me some ideas about how to change default 'search' action ?

Thank you a lot,
Best regards!

MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Re: How to change default 'search' action in admin tab ?

Post by MikaelNazarenko » 01 Jul 2019, 09:32

To overwrite navbar items everyone should edit ./config/shop.php as follow:

Code: Select all

'admin' => [
	    'jqadm' => [
	        'navbar' => [
	            'dashboard',
                'profile',
                'documents'
            ],
            'resource' => [
                'profile' => [
                    /** admin/jqadm/resource/product/groups
                     * List of user groups that are allowed to access the product panel
                     *
                     * @param array List of user group names
                     * @since 2017.10
                     */
                    'groups' => ['admin', 'editor', 'super'],

                    /** admin/jqadm/resource/product/key
                     * Shortcut key to switch to the product panel by using the keyboard
                     *
                     * @param string Single character in upper case
                     * @since 2017.10
                     */
                    'key' => 'P',
                ],
                'documents' => [
                    /** admin/jqadm/resource/product/groups
                     * List of user groups that are allowed to access the product panel
                     *
                     * @param array List of user group names
                     * @since 2017.10
                     */
                    'groups' => ['admin', 'editor', 'super'],

                    /** admin/jqadm/resource/product/key
                     * Shortcut key to switch to the product panel by using the keyboard
                     *
                     * @param string Single character in upper case
                     * @since 2017.10
                     */
                    'key' => 'D',
                ],
            ],
        ]
    ],
But if someone can give me ideas how to change default search action in admin tabs - I will be very thankful!

User avatar
aimeos
Administrator
Posts: 7889
Joined: 01 Jan 1970, 00:00

Re: How to change default 'search' action in admin tab ?

Post by aimeos » 01 Jul 2019, 11:20

Simplest way is to overwrite the "page" template and add an if/else condition for your panel where you use something else than "search" as action: https://github.com/aimeos/ai-admin-jqad ... d.php#L218
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply