Page 1 of 3

Creating a subcomponent

Posted: 19 Aug 2015, 09:57
by Bananamoon
Hi! :-) (sorry for spamming this forum!)

I'm trying to overwrite the default breadcrumb, but am not sure how to do this.
I know how to create a new component, and was just wondering if this goes the same way for a subcomponent?

So from a default subcomponent it becomes a component that you have to add in the shop config file in order to show it on a page, or am I wrong in this?

Thanks again for your help! :-)

Re: Creating a subcomponent

Posted: 19 Aug 2015, 10:39
by aimeos
Bananamoon wrote: I'm trying to overwrite the default breadcrumb, but am not sure how to do this.
I know how to create a new component, and was just wondering if this goes the same way for a subcomponent?

So from a default subcomponent it becomes a component that you have to add in the shop config file in order to show it on a page, or am I wrong in this?
Every question is welcome! :-)

You can create a new breadcrumb template if you want to change the layout: https://aimeos.org/docs/Developers/Html ... _templates
If you need more information in your template and want to overwrite the breadcrumb component, you can extends the existing implementation and overwrite the _setViewParams() method:
https://aimeos.org/docs/Developers/Html ... rams.28.29

Does this answer your question?

Re: Creating a subcomponent

Posted: 19 Aug 2015, 11:05
by Bananamoon
aimeos wrote:
Bananamoon wrote: I'm trying to overwrite the default breadcrumb, but am not sure how to do this.
I know how to create a new component, and was just wondering if this goes the same way for a subcomponent?

So from a default subcomponent it becomes a component that you have to add in the shop config file in order to show it on a page, or am I wrong in this?
Every question is welcome! :-)

You can create a new breadcrumb template if you want to change the layout: https://aimeos.org/docs/Developers/Html ... _templates
If you need more information in your template and want to overwrite the breadcrumb component, you can extends the existing implementation and overwrite the _setViewParams() method:
https://aimeos.org/docs/Developers/Html ... rams.28.29

Does this answer your question?
Thanks for the info! Altho I'm still not sure how to implement the template.
I copied the

Code: Select all

Client/Html/Catalog/Stage/Breadcrumb/Default.php 
to

Code: Select all

ext/ai-project/client/html/src/Client/Html/Catalog/Mystage/Default.php
I extended like this:

Code: Select all

class Client_Html_Catalog_Optistage_Default
	extends Client_Html_Catalog_Stage_Default

I'm not sure if this is the correct way, since it doesn't seem to use this file so far. Am I missing something?
Thanks again for your help :-)

On side node, could you also check my other question please? laravel-package-f18/modify-the-basket-m ... -t468.html :oops: Thank you!

Re: Creating a subcomponent

Posted: 19 Aug 2015, 12:38
by Luke
Hi,

I am also having a similar issue, did you manage to fix it or is there someone on the board who could help ?

Re: Creating a subcomponent

Posted: 19 Aug 2015, 14:10
by aimeos
Bananamoon wrote: Thanks for the info! Altho I'm still not sure how to implement the template.
I copied the

Code: Select all

Client/Html/Catalog/Stage/Breadcrumb/Default.php 
to

Code: Select all

ext/ai-project/client/html/src/Client/Html/Catalog/Mystage/Default.php
I extended like this:

Code: Select all

class Client_Html_Catalog_Optistage_Default
	extends Client_Html_Catalog_Stage_Default

I'm not sure if this is the correct way, since it doesn't seem to use this file so far. Am I missing something?
It's much easier, if you only want to change the template. You don't need to create a new component (Optistage) but only configure a new template for the breadcrumb body of the existing catalog stage breadcrumb: https://aimeos.org/docs/Configuration/C ... plate-body

Place it in your Aimeos extension and it will be used after you cleared the content cache (if you didn't disable content caching by default in your dev environment).

Re: Creating a subcomponent

Posted: 19 Aug 2015, 14:26
by Bananamoon
aimeos wrote:
Bananamoon wrote: Thanks for the info! Altho I'm still not sure how to implement the template.
I copied the

Code: Select all

Client/Html/Catalog/Stage/Breadcrumb/Default.php 
to

Code: Select all

ext/ai-project/client/html/src/Client/Html/Catalog/Mystage/Default.php
I extended like this:

Code: Select all

class Client_Html_Catalog_Optistage_Default
	extends Client_Html_Catalog_Stage_Default

I'm not sure if this is the correct way, since it doesn't seem to use this file so far. Am I missing something?
It's much easier, if you only want to change the template. You don't need to create a new component (Optistage) but only configure a new template for the breadcrumb body of the existing catalog stage breadcrumb: https://aimeos.org/docs/Configuration/C ... plate-body

Place it in your Aimeos extension and it will be used after you cleared the content cache (if you didn't disable content caching by default in your dev environment).
Yay! It all works! :-) Thank you so much for your help!

Re: Creating a subcomponent

Posted: 19 Aug 2015, 14:38
by Luke
Hi,

I am having a similar issue, I am wanting to override the item details default.php
path = ext/ai-rotex/client/html/src/Client/Html/Catalog/Detail

I want to remove the social from the subpaths but it's not working any ideas what I am doing wrong.
my new class =

Code: Select all

class Client_Html_Catalog_RotexDetail_Default
   extends Client_Html_Catalog_Detail_Default

Re: Creating a subcomponent

Posted: 19 Aug 2015, 15:00
by aimeos
Luke wrote:Hi,

I am having a similar issue, I am wanting to override the item details default.php
path = ext/ai-rotex/client/html/src/Client/Html/Catalog/Detail

I want to remove the social from the subpaths but it's not working any ideas what I am doing wrong.
Very simple: Only configure the https://aimeos.org/docs/Configuration/C ... t/subparts setting and leave out the "social" string.

Re: Creating a subcomponent

Posted: 19 Aug 2015, 15:43
by Luke
Hey,

That is exactly what I have done but it doesn't seem to be working, what could my new class name be ? it cannot be the same name as the one I am extending can it.

Re: Creating a subcomponent

Posted: 19 Aug 2015, 15:48
by Luke
are you able to give me an example directory structure and class name / filename