Download the PHP package carlcs/craft-elementstats without Composer
On this page you can find all versions of the php package carlcs/craft-elementstats. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download carlcs/craft-elementstats
More information about carlcs/craft-elementstats
Files in carlcs/craft-elementstats
Package craft-elementstats
Short Description Element Stats widget for Craft CMS
License
Informations about the package craft-elementstats
Element Stats widget for Craft CMS
Installation
The plugin is available on Packagist and can be installed using Composer. You can also download the latest release and copy the files into craft/plugins/elementstats/.
Configuration
To configure the plugin you need to create a file named elementstats.php in the craft/config/ folder. This is where you configure the stats available in your widgets.
Place all of your stats configurations in a nested array with the key stats
. The configurations themselves have to be arrays with an unique array key which will be used to identify the stat. Within that array you can use the following stat config settings:
name
– What the stat will be called in the widget.link
– Where the link in your widget will lead. The setting expects a Control Panel URI.elementType
– What element type to fetch elements.criteria
– An array of element criteria parameters used to filter the elements.dateColumn
– What database column should be used for the time axis in the chart.total
– Allows you to manually set the value returned to the widgets.numberFormat
– How the value should be formatted in the widgets.
Element Stats widget comes with an example configuration file to give you a better idea of what types of data you can use and how to configure the stats configurations.
Here’s a very basic example:
Requirements
- PHP 5.4 or later
- Craft CMS 2.6 or later