adobe / aem-core-cif-components

A set of configurations and components to get you started with AEM Commerce development
Apache License 2.0
102 stars 80 forks source link

Sitemap generation for dynamic Pages using CIF core components #963

Closed AAMANATHULLAH closed 1 year ago

AAMANATHULLAH commented 1 year ago

We are trying to generate sitemap for our site using Apache Sling Sitemap We have dynamic pages in our site for PDP and PLP, where we are using CIF (Commerce integration framework) We are unable to include dynamic pages in Sitemap CIF core components documentation mentions support for dynamic pages in sitemap (https://github.com/adobe/aem-core-cif-components/releases?page=2) Can you please help us in implementation to get these dynamic pages included in sitemap using CIF core components

buuhuu commented 1 year ago

Thanks @AAMANATHULLAH for your request.

Please follow the instructions on https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/overview/seo-and-url-management.html?lang=en#building-an-xml-sitemap-on-aem

With that set up, in the page properties of your Site's landing page, enable the "Generate Sitemap" checkbox. This will generate a sitemap and sitemap index at your sites landing page level, for example /content/venia/us/en.sitemap.xml.

Afterwards you can enable the same setting on the generic PLP and PDP page. This will add them as nested sitemaps to the sitemap index generated for the landing page.

AAMANATHULLAH commented 1 year ago

Thanks for your inputs @Buuhuu

I followed the same steps and i am able to generate sitemap for static pages in our site

But we do have dynamic PDP and PLP pages, which does not exist in AEM content structure We have a single page each for both PDP and PLP and we use suffix in URL to load the respective PDP and PLP data We are not able to fetch the dynamic PDP and PLP pages in the sitemap (Note: We are using commerce integration framework to integrate AEM with Magento and get the Products and category data) Sample PLP and PDP URL's http://localhost:4502/content/venia/us/en/commerce/products/plp.html/categoryxx.html (where categoryxx would be categroy name.) http://localhost:4502/content/venia/us/en/commerce/products/product.html/xyz.html (where xyz would be product url_key)

We need help on implementing SitemapProductFilter and SitemapCategoryFilter as mentioned in below link https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/overview/seo-and-url-management.html?lang=en#building-an-xml-sitemap-on-aem

image

buuhuu commented 1 year ago

We have a single page each for both PDP and PLP and we use suffix in URL to load the respective PDP and PLP data

Enable the "Generate Sitemap" option for those two pages. Make sure that they are configured on the Landing Page as Product / Category Page (Commerce Tab in the Page Properties).

Please be aware that initial support for Product / Category sitemaps was added with version 2.0.0 with some further bug fixes introduced in later versions. You should use at least version 2.4.0.

We need help on implementing SitemapProductFilter and SitemapCategoryFilter as mentioned in below link

These services are optional and not needed to get the sitemaps generated.

AAMANATHULLAH commented 1 year ago

We are using CIF core components version2.10.0 We are using custom templates (with page core component) for PDP and PLP pages instead of CIF OOTB templates, hence we do not have commerce tab in page properties We are rendering PDP and PLP pages by fetching commerce data using sing models which implements OOTB sling models Product, ProductList using delegation pattern sling models
com.adobe.cq.commerce.core.components.models.productlist.ProductList; com.adobe.cq.commerce.core.components.models.product.Product

Is there any way to get all the PDP and PLP pages included in sitemap, using custom templates (as per our current structure) @Buuhuu Please suggest

AAMANATHULLAH commented 1 year ago

@Buuhuu I enabled the "Generate Sitemap" option for those two pages (PDP, PLP). I also configured these two pages on the Landing Page as Product / Category Page Landing page has below page properties now cq:cifCategoryPage = /content/xxxx/us/en/commerce/products/plp cq:cifProductPage = /content/xxxx/us/en/commerce/products/product Please find the attached screenshot for reference image When i try to generate sitemap , i am not getting the product and category pages under sitemap can you please provide your inputs

buuhuu commented 1 year ago

We figured out offline that the navRoot=true property was not set on the langing page and hence the pdp/plp were not considered as such.

AAMANATHULLAH commented 1 year ago

Thanks @Buuhuu for your support