Skip to main content
The ContentService is used to get the data of the base theme configured in Admin Panel. You can import the ContentService from the experro-storefront package.
Here is a list of functions that the ContentService provides.
  1. getSingleTypeContent
  2. getCollectionRecordsByCollectionInternalName
  3. getCollectionTypeContentById
  4. getMenuById
  5. getContentModelRecordsByFieldKeyValue

getSingleTypeContent

This function returns the single type data. This function accepts an object with modelName as the property.

getCollectionRecordsByCollectionInternalName

This function returns the record list by id, versionId, modelName, and componentId.
If you’re fetching the “zig zag banner”, then will get a response similar to shown below.

getCollectionTypeContentById

This function returns the collection type by content id. This function accepts an object with the properies you get from getCollectionRecordsByCollectionInternalName function call.
The id in ssrKey should be any unique value for each API call. If same duplicate id is found, it may behave differently.

getMenuById

This function returns menu or navigation created in Admin Panel. This function accept menuId.

getContentModelRecordsByFieldKeyValue

This function returns all the records by the model internal name. If you’ve created the “zig zag banner”, with this method, you’ll get all the records for this “zig zag banner” as an array of objects contains data for the “zig zag banner”.
To fetch the specific data, we can mention the name of the fields in fieldsToQuery e.g.,
Following are the list of other options that you can pass with this method.
Note: The following properties need to be used together: sortBy and sortType limit and skip