NAR
NAR

Reputation: 57

Page service in spartacus?

If CMSService.getComponentData() is to get the component data (Component Controller in swagger).

May I know what service is needed to get page data with list of CMS content slots (Page Controller in swagger)?

Upvotes: 1

Views: 935

Answers (1)

tobi-or-not-tobi
tobi-or-not-tobi

Reputation: 1260

The CmsService from the core lib provides a method to get the current page, based on the current route:

CmsService.getCurrentPage()

This returns an observable with a Page.

Under the hood, the page is selected based on the page context, which has a page type (product, category, content) and id (product code, category code, search query).

Upvotes: 1

Related Questions