Building a Purple Experience
views.json
View
1 min
consider views as distinct pages within your app – like the main homepage, a list of articles from a specific category, a detailed article page, or subscription offers you can configure a view to display contents based on filters using different components in that view in pxp < 4 0, all views are set up and administered in one large views json file, located in storefront/assets from pxp 4 0, views are created inside a folder structure in storefront/assets/views a pipeline is automatically run to create the large views json from that views have the following fields = required field field description name defines the class name which will be added to the dom element "storefront view" therefore, we recommend using a lower case name without spaces, so it works well as a css selector path describes under which url the view will be accessible (exception experience routing docid\ s4eu5ubll5qnrohm3w wo ) note the root view must have the path / , all other paths must not start with a slash running the split views approach, the path is taken from the path in the views folder refer to split views docid\ kxmx0xdffeldjq7z4lqlx for details pulltorefresh the view will automatically be updated on any changes caused by app resumes or invalidations (e g caused by a login or a purchase) if 'pulltorefresh' is activated, manual updates via a pull gesture will also trigger an update appbar if 'appbar' is set, it shows the top app bar with the matching id from the appbar json navigation if 'navigation' is set, it shows the bottom sticky navigation bar with the matching id from the navigation json content 'content ' defines the content of the page, composed of different possibly nested inspecting components docid\ i2nqgh5hbvmjyzw6ichky data 'data' stands for a list of data sources & catalog api docid\ fmhcpmndgjfgymahhv ne that are required throughout the page you may set up data sources to be loaded per view or from the components defined above title the \<title> tag text is shown in the browser's bar and search engine entries you can use $context, $functions or $global expressions, but it is not reactive (e g only set once) the \<title> tag is relevant to be set for seo postview 'postview ' is set for the simple opening of content based on 'posttype' we recommend using the url resolver as it gives more flexibility cache allows configuring the cache control header by specifying maxage, stalewhilerevalidate and staleiferror values are set in seconds if none are set, defaults are used, see tooltips for the current defaults see cloudfront docs https //docs aws amazon com/amazoncloudfront/latest/developerguide/expiration html for more information on the cache control header seo adds metadata tags to the rendered html, e g for open graph properties see seo view configuration docid\ cu7hafs68vq0qcxn8vnpm for more details pageconfigs currently used for setting up traffective tracking viewtrackingparams additional tracking parameters for view tracking events jsonld a string representing the jsonld config to pass additional information to search engine crawlers errorpage if true, the page is treated as an error page