cancel
Showing results for 
Search instead for 
Did you mean: 

How does Spartacus injects "LandingPage2Tempate" in the main Section of cx-storefront html

Yashwanth
Advisor
Advisor

Hi Experts,

I am trying to understand how Spartacus renders the components defined in the content slot of Landing2PageTemplate.

On Observing the <cx-storefront> component and HTML. There is section <main> . All the content slot for the pageLayout is rendered before the <router-outlet></router-outlet>.

Can you please point me in a direction where I can check the code which indjects the pageslot and its component inside main section


Thank you
Yashwanth

Accepted Solutions (1)

Accepted Solutions (1)

safin
Advisor
Advisor

Hi Yashwanth,

The basic thinking is as follows:

(1) Based on current url, Spartacus will invoke the backend SAP Commerce Cloud to decide the current page template and related information triggered by <router-outlet> tag

(2) PageLayoutComponent will refer to LayoutConfig will decide what slots need to be processed in which order

(3) For each slot, PageSlotComponent will be used to render the components one by one (as of which components are in the current slot, these information are gotten from step 1)

I just give you the overall process at high level, you can debug and research more details, hopefully, it can help you a little.

Thanks

Yashwanth
Advisor
Advisor
0 Kudos

Thanks , I totally forgot about importance of router-outlet. Need to read Router basics again

Answers (0)