View settings
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 that will be added to the dom element "storefront view" therefore, we recommend using a lowercase name without spaces so it works well as a css selector path describes under which url the view will be accessible (exception using the url resolver for dynamic paths 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 view configuration 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 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 in general, our defaults are the page has a max age of 60 (1 minute), afterwards it is deemed stale we set stale while revalidate headers to 3600 (1 hour), so even if a page is stale, it may be served during this timeframe to the user but also trigger a new render on server side, so that a following request then serves a new response, which was just rendered in the background this is mostly there for users to quickly get a working website instead of waiting 3+ seconds for a full render finally, we also serve stale if error with 86400 (1 day) if the server failed to render a page, cloudfront or the browser is allowed to serve a previously cached page even if it is up to 1 day old 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 https //json ld org/ config to pass additional information to search engine crawlers errorpage if true, the page is treated as an error page