Issues with creating Subparts
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!
Issues with creating Subparts
In building out item subparts, I found a few issues in the docs that should be fixed:
Environment:
- In the template code snippet example for the subpart, it is missing the "vue" class in the div
- Also in the template code, the divs at the end should be closing divs, they are missing the slashes
- In order to get subparts working, I had to add the following into my parent get method: I'm not entirely sure that is the best way to handle it but once I did that, the "link" showed up on the screen. This could be a bug in the parent class because I could tell from logging that the getSubClientNames() method was being called.
Code: Select all
$view->set('itemSubparts', $this->getSubClientNames());
Environment:
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
Re: Issues with creating Subparts
The vue CSS class is already in the example template ( "<div class="col-xl-6 vue"):
https://aimeos.org/docs/latest/admin/jq ... /#template
Or did you mean somewhere else?
That has been fixed.
We've added documentation for the data() method where this should be added:jafo66 wrote: ↑15 Apr 2024, 13:35 [*]In order to get subparts working, I had to add the following into my parent get method:I'm not entirely sure that is the best way to handle it but once I did that, the "link" showed up on the screen. This could be a bug in the parent class because I could tell from logging that the getSubClientNames() method was being called.Code: Select all
$view->set('itemSubparts', $this->getSubClientNames());
https://aimeos.org/docs/latest/admin/jq ... nels/#data
Thank you very much for pointing out the issues!
![Lächeln :-)](./images/smilies/icon_e_smile.gif)
We've fixed them already and we appreciate any contributions to make the Aimeos docs better.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)
Re: Issues with creating Subparts
Thanks for the updates.
Where the "vue" class needs to be is a tad confusing. I now have it working without the vue class included anywhere in the subpart code. It is in the parent code, so I'm not sure I follow when / where that should get included.
On the data() method, I implemented the method from the docs but it doesn't seem to be called automatically. Should I be including it in the get() method call?
Thanks!
Where the "vue" class needs to be is a tad confusing. I now have it working without the vue class included anywhere in the subpart code. It is in the parent code, so I'm not sure I follow when / where that should get included.
On the data() method, I implemented the method from the docs but it doesn't seem to be called automatically. Should I be including it in the get() method call?
Thanks!
aimeos wrote: ↑15 Apr 2024, 15:41The vue CSS class is already in the example template ( "<div class="col-xl-6 vue"):
https://aimeos.org/docs/latest/admin/jq ... /#template
Or did you mean somewhere else?
That has been fixed.
We've added documentation for the data() method where this should be added:jafo66 wrote: ↑15 Apr 2024, 13:35 [*]In order to get subparts working, I had to add the following into my parent get method:I'm not entirely sure that is the best way to handle it but once I did that, the "link" showed up on the screen. This could be a bug in the parent class because I could tell from logging that the getSubClientNames() method was being called.Code: Select all
$view->set('itemSubparts', $this->getSubClientNames());
https://aimeos.org/docs/latest/admin/jq ... nels/#data
Thank you very much for pointing out the issues!
We've fixed them already and we appreciate any contributions to make the Aimeos docs better.
Re: Issues with creating Subparts
The "vue" CSS class creates an own instance of a Vue application for the HTML within. If you add that class at a parent node which contains the basic tab including all subparts, then this single Vue application will used for every VueJS related code in all panel item and subpart templates. But there will be conflicts if you do that and add a "vue" class to the subpart template too!
Yes, you need to use this in every method where you need the data added to the templates:
$view = $this->object()->data( $this->view() );
We've updated the docs accordingly. Thanks for the hint!
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
![Image](https://aimeos.org/fileadmin/aimeos.org/icons/star.png)