Some use cases include:
The X-Partial-Render header tells Miva which part of the page you want returned. It values will be a single item code or list of items codes which assigned to the page you’re requesting.
Optionally you can specify an md5 hash of any param values you want to include in the item request. The most common use case for this will be requesting a ReadyTheme item such as a content section:
<mvt:item name="readytheme" param="contentsection( 'mini_basket' )" />
To request this item you would pass readytheme:24a308d4d1c2fc38a620b980f182a9f2 as the header where 24a308d4d1c2fc38a620b980f182a9f2 is the md5 hash of 'contentsection( 'mini_basket' )'
Only items that have a template output will return any response. For example, if you request the “store” item since it does not have an output template, nothing will be returned.
The X-Partial-Render-Output header is optional and defines the output format and content-type of the response.
There are two possible values: raw or json
If you set the render output as json the response will look like this:
The param_hash is always returned even if there was no parameter passed in the request
If you are getting the response back as raw/html the response will be in the order you request each item.
When building advanced user interface experiences or even building a native mobile app its useful to be able to pull list of products assigned to a category. This can easily be done by requesting that category and the category_listing item. You can even get facets generated by Miva if you need facet data.
Some sites will want to display a modal of the product listing. You can leverage the same template that already exists on PROD and just call it in and display it in a modal on the category page. This gives you a single location to make layout changes without having to maintain code in multiple places.
One of the most powerful aspects of this feature is the ability to create your own JSON output to use in your user experience. Let say you wanted a list of all categories output in JSON. You could just request the category_tree item but this will have the full html template. Instead, we can create a custom page, assign the content component and output anything we want.
Here is an example:
To see a list of any available item for any page, navigate to the page under User Interface -> Templates then click the item tab and sort by assigned items. These are all the possible values for a given page which can be requested using the X-Partial-Render header