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.
|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
||The size of the report cards. Available sizes:
You can add as many reports to your stats section as needed. Each report can be customized to fit your data.
Each report must have a label and value
The info text is shown below the value and is optional. It can be fully customized.
Reports can have a link to a source or more details. Links can be absolute or relative.
You can colorize the info value with the theme option. Available themes are:
All parts of a report can be translated by defininig an associative array with translations
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.
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:
The size option controls the size of the report cards.