Blogs
The storefront renders blogs dynamically with the content that is driven by a headless content management system (CMS). The CMS facilitates drafting, publishing & scheduling pages with content versioning. A folder named "Blogs" is created on the CMS. Any page content published inside the "Blogs" folder is listed as a blog on the storefront.
The system also allows the storefront to create channel specific content on the page. A channel can be Web, Mobile Web, Mobile App and Store.
Blogs List Page
All pages created inside the "Blogs" folder on the CMS are listed on the blogs list page. It displays a list of blogs with details like thumbnail image, short description and last published timestamp.
The content is fetched on the blogs list with the following API operation:
Operation | Endpoint | Response |
---|---|---|
Fetch list of all pages by blog page type id | /api/v2/page/list | Gets the list of blogs with details like blog header image , blog title , last updated timestamp . |
The above endpoint also provides the flexibility of fetching custom field values specified inside cols
parameter. To fetch multiple fields it accepts a comma-separated string, for e.g. - "blogheader.blogheader_mainimage,category".
The page content is cached on the server-side and after content edits it needs to be cleared so that the newer version of the content is reflected on the front-end.
The content cache is cleared with the following API operation:
Operation | Endpoint | Response |
---|---|---|
Clear Content Cache | /api/v1/page/cache/clear | Clears content cache on the server-side to reflect newer changes on the front-end. |
Blog Detail Page
The storefront renders blog content from the content management system. The blog detail page opens when the end-user navigates to the specific blog from the blog list page.
The following API operations are used on the blog list page
Operation | Endpoint | Response |
---|---|---|
Fetch blog content based on page id and/or slug | /api/v2/page | Details of data created for the blog page on CMS like blog header image , blog title , blog content , published by , published date . |
The page content is cached on the server-side and after content edits it needs to be cleared so that the newer version of the content is reflected on the front-end.
The content cache is cleared with the following API operation:
Operation | Endpoint | Response |
---|---|---|
Clear Content Cache | /api/v1/page/cache/clear | Clears content cache on the server-side to reflect newer changes on the front-end. |