Adding Menu Items to Admin Panel
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Adding Menu Items to Admin Panel
Code: Select all
Php version: 8.2.15
Versions:
aimeos/ai-laravel 2023.10.5
aimeos/aimeos-laravel 2023.10.8
inertiajs/inertia-laravel v0.6.11
laravel/framework v10.48.3
laravel/jetstream v4.3.1
laravel/serializable-closure v1.3.3
spatie/laravel-ignition 2.4.2
OS version: MacOs 14.4
Right now, I'm working on adding new panels to the admin screens. I have a few questions below.
NOTE: I have made an extension which has been registered into the project. Per the documentation, I'm trying to perform my changes within the extension and not touch any of the aimeos code.
1a) How do I add one off translations to proper capitalize the menu items? I did try to create a en.php in the i18n directory but I don't think that works or I didn't configure it properly.
1b) How do I add the icon properly? That code below should pull back a basketball (free version), but it comes back with a different icon. Source: https://fontawesome.com/icons/basketbal ... ic&s=solid
Here is my admin.php:
Code: Select all
<?php
return [
'jqadm' => [
'navbar' => [
15 => [
'_' => 'tournament',
10 => 'season',
],
],
'resource' => [
'tournament' => [
'groups' => ['editor', 'admin', 'super'],
],
'season' => [
'groups' => ['editor', 'admin', 'super'],
],
]
],
'jsonadm' => [
],
];
Code: Select all
.aimeos .main-sidebar .menuitem-tournament i.icon:before {
content: "\F434"
}
3) How would I add a field to the product screen when the product type is "event"? I'm looking to add a season drop down to the event as it is being configured. I would prefer to put it on the main product screen and not on a subpanel if at all possible. I'm also thinking there are a few things I would like to hide.
Re: Adding Menu Items to Admin Panel
If you want to add translation to PO files instead of the ./config/shop.php, you have to compile the .po file to an MO file to be used: https://aimeos.org/docs/latest/developer/translations/
We don't use FontAwesome due to their licensing any more for a long time but the .fa CSS classes are still there. Instead, we use the Bootstrap icons:jafo66 wrote: ↑22 Mar 2024, 02:04 1b) How do I add the icon properly? That code below should pull back a basketball (free version), but it comes back with a different icon. Source: https://fontawesome.com/icons/basketbal ... ic&s=solid
- https://github.com/aimeos/ai-admin-jqad ... on.css#L11
- https://icons.getbootstrap.com/
Unfortunately, there's not basket ball icon included there.
The documentation was outdated and we've fixed it now. The correct path is ./src/Admin/JQAdm/jafo66 wrote: ↑22 Mar 2024, 02:04 2) I'm not following the documentation in how to add the panel. In the documentation, it is not clear which directory the panel code should go into. In the docs here: https://aimeos.org/docs/latest/admin/jq ... nt-panels/, it has the directory as ./admin/jqadm/src/...., but if I look at the most recent ai-admin-jqadm package (I'm assuming is typical extension), the source code is in src/Admin/JQAdm/... Can you confirm if I follow the ai-admin-jqadm structure, stuff should work or should I be following the docs?
Adapt the product/item.php template here:jafo66 wrote: ↑22 Mar 2024, 02:04 3) How would I add a field to the product screen when the product type is "event"? I'm looking to add a season drop down to the event as it is being configured. I would prefer to put it on the main product screen and not on a subpanel if at all possible. I'm also thinking there are a few things I would like to hide.
https://github.com/aimeos/ai-admin-jqad ... t/item.php
Add the necessary CSS and JS in the themes/admin/jqadm/custom.{css,js} files.
Keep in mind, that you can only save product item properties in the basic tab automatically if you add them via a decorator for the product manager:
https://aimeos.org/docs/latest/models/e ... /#easy-way
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Adding Menu Items to Admin Panel
Sorry for the newbie question, can you have a shop.php file in the extension OR that has to be done in the normal project?aimeos wrote: ↑24 Mar 2024, 11:00 If you want to add translation to PO files instead of the ./config/shop.php, you have to compile the .po file to an MO file to be used: https://aimeos.org/docs/latest/developer/translations/
jafo66 wrote: ↑22 Mar 2024, 02:04 1b) How do I add the icon properly? That code below should pull back a basketball (free version), but it comes back with a different icon. Source: https://fontawesome.com/icons/basketbal ... ic&s=solid
Thanks for looking, I did actually find one (called "dribble") but I appreciate you checking.aimeos wrote: ↑24 Mar 2024, 11:00 We don't use FontAwesome due to their licensing any more for a long time but the .fa CSS classes are still there. Instead, we use the Bootstrap icons:
- https://github.com/aimeos/ai-admin-jqad ... on.css#L11
- https://icons.getbootstrap.com/
Unfortunately, there's not basket ball icon included there.
jafo66 wrote: ↑22 Mar 2024, 02:04 2) I'm not following the documentation in how to add the panel. In the documentation, it is not clear which directory the panel code should go into. In the docs here: https://aimeos.org/docs/latest/admin/jq ... nt-panels/, it has the directory as ./admin/jqadm/src/...., but if I look at the most recent ai-admin-jqadm package (I'm assuming is typical extension), the source code is in src/Admin/JQAdm/... Can you confirm if I follow the ai-admin-jqadm structure, stuff should work or should I be following the docs?
Thank you!
jafo66 wrote: ↑22 Mar 2024, 02:04 3) How would I add a field to the product screen when the product type is "event"? I'm looking to add a season drop down to the event as it is being configured. I would prefer to put it on the main product screen and not on a subpanel if at all possible. I'm also thinking there are a few things I would like to hide.
Thanks for information. One modifying the template, do you have good way to make sure I don't lose out on upgrades in the future?aimeos wrote: ↑24 Mar 2024, 11:00 Adapt the product/item.php template here:
https://github.com/aimeos/ai-admin-jqad ... t/item.php
Add the necessary CSS and JS in the themes/admin/jqadm/custom.{css,js} files.
Keep in mind, that you can only save product item properties in the basic tab automatically if you add them via a decorator for the product manager:
https://aimeos.org/docs/latest/models/e ... /#easy-way
Re: Adding Menu Items to Admin Panel
You can ignore the shop.php question... I have it working in the project which is good for our solution.
Re: Adding Menu Items to Admin Panel
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star