Creating a subcomponent
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Creating a subcomponent
Yes, it extends (no inheritance) the basket/mini component dynamically but doesn't overwrite it. You can now assign more data to the view and use it in the templates.Bananamoon wrote: Yay Error gone! Altho I have no clue what to do now, since I thought that this file would extend/overwrite this file:Code: Select all
class Client_Html_Basket_Mini_Main_Default extends Client_Html_Abstract
OK, you have two options to fetch the product data depending on your basket content and display it:Bananamoon wrote: I'm at loss, I guess I made the wrong extension or something?
My main purpose is to show the products I put in my basket, instead of just the amount of products. I would like to add that to the cache so it loads quicker, so I figured I have to extend/overwrite above file and rewrite the _setViewParams.
1.) You can change your decorator to decorate the "basket/mini/main" subpart instead of the "basket/min" component so the resulting HTML will be cached. In this case you have to overwrite the existing "basket/mini/main" template and add your additional HTML code there, but this isn't the best option because this leads to a tight coupling of both and will make it hard to reuse it.
2.) Instead, I would recommend to create a new "basket/mini/product" subpart (https://aimeos.org/docs/Developers/Html ... w_subparts) that is independent of the "main" subpart. In that subpart, you have more freedom. This can be reused in other projects as well and we would love to get a pull request to integrate it into the core so you don't have to care about updates in the future
-
- Posts: 26
- Joined: 22 Jun 2015, 09:12
Re: Creating a subcomponent
Yay! I'd love to send a pull request!aimeos wrote:Yes, it extends (no inheritance) the basket/mini component dynamically but doesn't overwrite it. You can now assign more data to the view and use it in the templates.Bananamoon wrote: Yay Error gone! Altho I have no clue what to do now, since I thought that this file would extend/overwrite this file:Code: Select all
class Client_Html_Basket_Mini_Main_Default extends Client_Html_Abstract
OK, you have two options to fetch the product data depending on your basket content and display it:Bananamoon wrote: I'm at loss, I guess I made the wrong extension or something?
My main purpose is to show the products I put in my basket, instead of just the amount of products. I would like to add that to the cache so it loads quicker, so I figured I have to extend/overwrite above file and rewrite the _setViewParams.
1.) You can change your decorator to decorate the "basket/mini/main" subpart instead of the "basket/min" component so the resulting HTML will be cached. In this case you have to overwrite the existing "basket/mini/main" template and add your additional HTML code there, but this isn't the best option because this leads to a tight coupling of both and will make it hard to reuse it.
2.) Instead, I would recommend to create a new "basket/mini/product" subpart (https://aimeos.org/docs/Developers/Html ... w_subparts) that is independent of the "main" subpart. In that subpart, you have more freedom. This can be reused in other projects as well and we would love to get a pull request to integrate it into the core so you don't have to care about updates in the future
Do you also need the HTML files with it? These have a different style than your shop, so I'm not sure if it's useful.
Re: Creating a subcomponent
Great!Bananamoon wrote: Yay! I'd love to send a pull request!
Do you also need the HTML files with it? These have a different style than your shop, so I'm not sure if it's useful.
Yes, the structural HTML would be needed and maybe the basic CSS. We can adapt the styles later
Thanks in advance
-
- Posts: 26
- Joined: 22 Jun 2015, 09:12
Re: Creating a subcomponent
Hi! I'm sorry for the immense delay, I had another project that needed to be finishedaimeos wrote:Great!Bananamoon wrote: Yay! I'd love to send a pull request!
Do you also need the HTML files with it? These have a different style than your shop, so I'm not sure if it's useful.
Yes, the structural HTML would be needed and maybe the basic CSS. We can adapt the styles later
Thanks in advance
Sooo, I'm implementing my changes so I can send you a pull request, altho I'm having a bit of an issue when it comes to the basic CSS. I'm using foundation and the whole basket menu is implemented in there.
I would create the basic style, so it matches your current theme, but I'm not really sure how I run my fork locally? Do I just put the Aimeos folder into the vendor folder of a new laravel project? or?
Thanks for the help!
Re: Creating a subcomponent
Don't excuse, that's normalBananamoon wrote: Hi! I'm sorry for the immense delay, I had another project that needed to be finished
Yes, the simplest way is to link your clone to the "./vendor/aimeos/aimeos-core" directory of your Laravel application. Beware that all CSS changes must be done in "./public/packages/aimeos/shop/themes" to see them (or you link "./vendor/aimeos/aimeos-core/client/html/themes" directly to "./public/packages/aimeos/shop/themes").Bananamoon wrote: I would create the basic style, so it matches your current theme, but I'm not really sure how I run my fork locally? Do I just put the Aimeos folder into the vendor folder of a new laravel project? or?
-
- Posts: 26
- Joined: 22 Jun 2015, 09:12
Re: Creating a subcomponent
Right, I'm trying this atm and am getting the following error:aimeos wrote:Don't excuse, that's normalBananamoon wrote: Hi! I'm sorry for the immense delay, I had another project that needed to be finished
Yes, the simplest way is to link your clone to the "./vendor/aimeos/aimeos-core" directory of your Laravel application. Beware that all CSS changes must be done in "./public/packages/aimeos/shop/themes" to see them (or you link "./vendor/aimeos/aimeos-core/client/html/themes" directly to "./public/packages/aimeos/shop/themes").Bananamoon wrote: I would create the basic style, so it matches your current theme, but I'm not really sure how I run my fork locally? Do I just put the Aimeos folder into the vendor folder of a new laravel project? or?
View [app] not found.
I followed the Aimeos guide for installing the package. Not sure what I'm missing?
Re: Creating a subcomponent
You need the base view for your application: https://github.com/aimeos/aimeos-laravel#setupBananamoon wrote: Right, I'm trying this atm and am getting the following error:
View [app] not found.
I followed the Aimeos guide for installing the package. Not sure what I'm missing?
Install the package like in the documentation first and then remove the "./vendor/aimeos/aimeos-core" directory and replace it with a link to your cloned repository. Otherwise, the configuration, views and assets are not copied.
-
- Posts: 26
- Joined: 22 Jun 2015, 09:12
Re: Creating a subcomponent
Okay! I think I have send a pull request!aimeos wrote:You need the base view for your application: https://github.com/aimeos/aimeos-laravel#setupBananamoon wrote: Right, I'm trying this atm and am getting the following error:
View [app] not found.
I followed the Aimeos guide for installing the package. Not sure what I'm missing?
Install the package like in the documentation first and then remove the "./vendor/aimeos/aimeos-core" directory and replace it with a link to your cloned repository. Otherwise, the configuration, views and assets are not copied.
-
- Posts: 26
- Joined: 22 Jun 2015, 09:12
Re: Creating a subcomponent
On a side note, where do I find the template that has the 'order' of each view?aimeos wrote:You need the base view for your application: https://github.com/aimeos/aimeos-laravel#setupBananamoon wrote: Right, I'm trying this atm and am getting the following error:
View [app] not found.
I followed the Aimeos guide for installing the package. Not sure what I'm missing?
Install the package like in the documentation first and then remove the "./vendor/aimeos/aimeos-core" directory and replace it with a link to your cloned repository. Otherwise, the configuration, views and assets are not copied.
On the list view there are 2 paginations (above the products and underneath the products), and the promos are above the top pagination. I would like to move them underneath the pagination, so they merge with the normal products. Altho I have no clue where I can find this layout.
So basic question: How can I move around the total layout?
Thank you!
Re: Creating a subcomponent
You can change the order of the catalog list component with this configuration option:Bananamoon wrote: So basic question: How can I move around the total layout?
https://aimeos.org/docs/Configuration/C ... t/subparts