Stats section
Show beautiful stats for your site or shop: revenues, orders, likes, views, etc.
Example
Section shortcuts
For simple sections that are only used once per blueprint, you can use shortcuts. In its most basic form, a stats
section consists of the section type as name, and the reports
property with the information you want to show.
Keep in mind that the same section name can only be used once per blueprint.
Section properties
Name | Type | Default | Description |
---|---|---|---|
headline | – | The headline for the section. This can be a simple string or a template with additional info from the parent page. | |
label | – | The label for the section. This can be a simple string or a template with additional info from the parent page. | |
reports | – | Array or query string for reports. Each report needs a label and value and can have additional info , link and theme settings. |
|
size | string |
large |
The size of the report cards. Available sizes: tiny , small , medium , large
|
Reports
You can add as many reports to your stats section as needed. Each report can be customized to fit your data.
Label & Value
Each report must have a label and value
Info
The info text is shown below the value and is optional. It can be fully customized.
Links
Reports can have a link to a source or more details. Links can be absolute or relative.
Themes
You can colorize the info value with the theme option. Available themes are:
positive
(green)negative
(red)notice
(orange)info
(blue)
Translations
All parts of a report can be translated by defininig an associative array with translations
Template strings
A report can be dynamic by querying data from pages, sites, collections or custom methods from plugins.
Here's a simplified example for a revenue method in a page model.
Queries
You can also generate an entire report in a page method for example and return an associative array with the report parts (label, value, info, theme, link). This will add extra flexibility and you can use logic in your methods to create dynamic reports.
Here's an example for the custom page method in a shop page model to create the revenue report.
Instead of querying individual reports, you can also query the entire report array at once:
Size
The size option controls the size of the report cards.
Available sizes:
tiny
small
medium
large
huge