Dynamic Design Previews
The Pixfizz platform exposes an API endpoint that makes it possible to preview pages from a design without creating a project. Only relevant when integrating Pixfizz with a 3rd-party CMS.
Formats
The previews are available in JPG, WebP, and SVG variants. SVG previews are recommended because they offer better performance and often look more crisp at small sizes.
SVG previews reference external images and therefore cannot be used in a src
attribute of an <img>
element. Use an <object>
element instead. Example:
URL Parameters
Design preview URLs have the following form:
theme-id
is the numeric ID of the design, page-name
is the name of the page as given in the pixfizz admin, and extension
is one of jpg
, webp
, or svg
.
query-params
allow you to request a different size of the image (default is 100px) and toggle element substitutions on the page through variant and template options.
The supported query parameters are:
width
height
variants[<variant-code>]
template_options[<option-code>]
Variants and template options of type text
accept the input text and multiple choice variants/template options expect the code of the selected option.
Examples
This simple example returns a 800px wide preview image:
This example returns the same 800px wide page preview, but toggles some template options to trigger element substitutions:
Last updated