Is there an easy way to add the PageType "VendorPage" to Spartacus?
Our Use case: We are using the marketplace extension in Hybris, which adds the VendorPage PageType. We now created a VendorPage Template (which is restricted to the VendorPage type) that makes it possible to create multiple vendor pages in SmartEdit. We want to access those pages via a URL that's something like: /vendor/vendorName. However, Spartacus always trys to fetch a ContentPage by default:
/cms/pages?fields=DEFAULT&pageType=ContentPage&pageLabelOrId=/vendor/vendorName
I investigated and found the router reducer, where the matching to the PageType takes place
if (params['productCode']) {
context = { id: params['productCode'], type: PageType.PRODUCT_PAGE };
} else if (params['categoryCode']) {
context = { id: params['categoryCode'], type: PageType.CATEGORY_PAGE };
} else if (params['brandCode']) {
context = { id: params['brandCode'], type: PageType.CATEGORY_PAGE };
} else if (state.data.pageLabel !== undefined) {
context = { id: state.data.pageLabel, type: PageType.CONTENT_PAGE };
} else if (!context) {
....
I then tried to replace this "CustomSerializer" in our application but then had to also define a custom "PageContext" type which lead to a "CmsActivatedRouteSnapshot" and at one point I got stuck because I landed in the state ngRx RouterState definition.
Am I going about this all wrong? Is there an easier way to add a new Cms PageType in Spartacus? Or maybe there is another way to achieve what we need?
/vendor/:vendorNameto send this request:/cms/pages?fields=DEFAULT&pageType=VendorPage&pageLabelOrId=vendorNameand then display the result like any other page - Armin