Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

How to add a link at each page aumatically?

Avatar

Former Community Member

Hi there,

Maybe there is a challenge case for me: i want to add a button or link "Add to Cart" at the top right corner for each page automatically, please see following screenshot:

[img]add2cart.png[/img]

 

It means that if user to open a instance of pagee/template, the button/link appear at there automatically. But i don't know how to write a script for that in AEM since i am new to that? Anyone could help see and give your comment here?

Thanks a lot.

 

Best regards,

Brian

1 Accepted Solution

Avatar

Correct answer by
Level 10

You add  AEM component to the page(s) during design time (including the cart component). Components are not added to AEM pages during run-time. In this case - you would add the component at design time. 

See the geometrixx-outdoors sample app for an example of the cart component:

http://localhost:4502/editor.html/content/geometrixx-outdoors/en/men/coats.html

[img]Cart.png[/img]

View solution in original post

2 Replies

Avatar

Level 10

Hi there,

Thank you for reaching out to Adobe Community.

Please go through the below link and see if it helps: We have the add to cart component under the commerce section.

https://docs.adobe.com/docs/en/aem/6-0/author/page-authoring/default-components/components.html

Thanks!

Avatar

Correct answer by
Level 10

You add  AEM component to the page(s) during design time (including the cart component). Components are not added to AEM pages during run-time. In this case - you would add the component at design time. 

See the geometrixx-outdoors sample app for an example of the cart component:

http://localhost:4502/editor.html/content/geometrixx-outdoors/en/men/coats.html

[img]Cart.png[/img]