heimrichhannot/contao-tiny-slider-bundle
Composer 安装命令:
composer require heimrichhannot/contao-tiny-slider-bundle
包简介
Tiny slider, a vanilla javascript content slider for contao.
README 文档
README
A slider bundle for contao based on Tiny Slider.
Features
- global configuration
- content elements for image and content sliders
- Encore Bundle support
- show List Bundle list as slider
- bundled config element type for List Bundle and Reader Bundle
Usage
Install
-
install bundle with composer or contao manager
composer require heimrichhannot/contao-tiny-slider-bundle -
Call contao install tool and update the database
Setup
- Create a tiny slider config (System -> Tiny-Slider). Please consider the tiny slider documentation for more informations about the different config options.
- Select the created config in a content element, an reader config element or in an list config after activating "Render as Tiny slider".
Usage as config element type (list and reader bundle)
This bundle comes with an config element type, already registered for list and reader bundle.
- Add 'Slider (Tiny Slider)' as list or reader config element to your configuration
- your defined template variable has two keys, html and images. html contains the complete slider, images just the prepared images if you want to define your own wrapper. So your typical template code to output a slider would be:
{% if tinySlider.html is defined %}
{{ tinySlider.html }}
{% endif %}
Twig usage
Tiny slider comes with an tiny_slider_wrapper.html.twig that can be embedded inside your custom twig template like the following:
{% set tinySliderConfigId = 1 %}
{% embed '@ContaoTinySlider/tiny_slider_wrapper.html.twig' with {config: tinySliderConfigId, selector: '.list-images', wrapperClass: 'overflow-hidden'} %}
{% block slides %}
<div class="image-container" {{ aos.default() }}>
<ul class="list-images list-unstyled">
{% for i, singleSRC in multiSRC %}
<li class="image">
{{ singleSRC|image([240,180,'px'],{href : url, lazyload: {class: 'tns-lazy-img', src: 'data-src'}})|raw }}
</li>
{% endfor %}
</ul>
</div>
{% endblock %}
{% endembed %}
There are also two twig extension available:
tiny_slider_wrapper_class
Returns the tiny slider wrapper css classes.
{% set tinySliderConfigId = 1 %}
{{ tinySliderConfigId|tiny_slider_wrapper_class}}
tiny_slider_container_attributes
Returns the tiny slider data-tiny-slider-config attribute for the container inside the wrapper. The parameter selector is optional and should point to the slides wrapper container.
{% set tinySliderConfigId = 1 %}
{{ config|tiny_slider_container_attributes(selector|default('.tiny-slider-container'))|raw }}
Custom transition effects
In order to use custom transitions for example using animate.css choose from the following effects.
Fade effect
- import animate.css stylesheet
- set tiny slider config parameter
Modetogallery - set tiny slider config parameter
Intro animationto 'fadeIn' - set tiny slider config parameter
Outro animationto 'fadeOut' - empty tiny slider config parameter
Normal animation
Assets
NPM/Yarn Package
The assets for this bundle are provided as NPM/Yarn package @hundh/contao-tiny-slider-bundle.
You will find the sources under src/Resources/npm-package.
Known Issues
Lazyload
If you use tiny-slider together with https://github.com/heimrichhannot/contao-speed-bundle and its lazyload compoment enabled in page layout, ensure that you enabled Lazy load in tiny slider configuration as well and keep the Lazy load selector default value to .tns-lazy-img.
If you use the TwigExtension image that you must provide proper lazyload information in data attributes:
{{ singleSRC|image([240,120,'px'],{lazyload: {class: 'tns-lazy-img', src: 'data-src'} }}
heimrichhannot/contao-tiny-slider-bundle 适用场景与选型建议
heimrichhannot/contao-tiny-slider-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.69k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2018 年 11 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「slider」 「carousel」 「contao」 「tiny slider」 「vanilla javascript」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 heimrichhannot/contao-tiny-slider-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 heimrichhannot/contao-tiny-slider-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 heimrichhannot/contao-tiny-slider-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Display a FlexSlider on pages of your website
Contao Open Source CMS
Diese Contao 4 Erweiterung stellt Google reCAPTCHA V2 in Form eines neuen Formularfeldes im Formulargenerator bereit. This extension provides Google reCAPTCHA V2 in the form of a new form field in the form generator of Contao Open Source CMS.
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
Slick slider element Silverstripe
yii2 swiper slider
统计信息
- 总下载量: 3.69k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 20
- 依赖项目数: 1
- 推荐数: 2
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2018-11-12