plenta/contao-countup-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

plenta/contao-countup-bundle

最新稳定版本:3.1.0

Composer 安装命令:

composer require plenta/contao-countup-bundle

包简介

This content element counts up numbers.

README 文档

README

This Contao content element counts up numbers.
This plugin is based on and uses CountUp.js.

CSS files are not included (coming soon).

Install using Composer

composer require plenta/contao-countup-bundle

Which version is right for you?

Contao Version PHP Version Contao Count Up Bundle Version
4.9.* >= 7.4 2.2.1
4.13.* >= 7.4 2.3.*
>= 5.3.0 >= 8.3 >= 3.0.0

Usage

To use this, simply add the Contao element to your page. The Contao element accepts the following options:

  • Start value: The number where the counter begins.
  • Count up value: The number where the counter ends.
  • Animation duration: The time (in seconds) for the animation to complete.
  • Prefix: Text added before the number.
  • Suffix: Text added after the number.
  • Number grouping: Enable grouping for large numbers (e.g., 1,000 instead of 1000).
  • Decimal places: Decimal places are automatically calculated.

Using Insert Tags

You can use insert tags to set the start and end values, but there are some rules:

  • The decimal point must be a . (dot) and the thousands separator must be a , (comma).
  • Both numbers must have the same format. For example, if one number has two decimal places, the other must also have two decimal places.
  • Only numbers are allowed.
  • The backend input fields can either accept numbers or insert tags, but not both in the same field.

Upgrade 2.* to 3.0.0

Templates

  • Old template name: ce_plenta_countup.html5
  • New template name: content_element/plenta_countup.html.twig

CSS Classes

Old New
.ce_plenta_countup .content-plenta-countup
.countUpPrefix .countup-prefix
.countUpValue .countup-value
.countUpSuffix .countup-suffix

JavaScript Location Changed

The JavaScript for the countup bundle has been moved. It is now inside the block script section of the new twig template. Previously, the JavaScript was added to the $GLOBALS['TL_BODY'] in the getResponse method of the content element controller.

Screenshot

Contao-Element

统计信息

  • 总下载量: 2.48k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-01-22