Git Product home page Git Product logo

at_slider's Introduction

AT Slider

This is a very simple module that provides slider blocks to your Drupal site.

Built on:

  • AT Base — For config, helper functions, …
  • Bean module — Block as Entity
  • Field Collection — Each slide (bean entity) has image or more information, like text, links, … FieldCollection module allow Drupal admin add fields to entity field.
  • Image — Provide image field for slider item.
  • Features — Used for preconfig things.
  • jQuery Cycle 2

Install

This is just a simple module, we can install it as same as other modules.

After install we need download jquery cycle library too. This can be simply done with Drush — run drush atr after enabled this module. If we do not have Drush available, we can download http://malsup.github.io/min/jquery.cycle.all.min.js to ./sites/all/libraries/jquery.cycle/jquery.cycle.all.min.js

Place the slider

A slider is a block, we can use block management UI to place the slider to place we want.

For more flexibility, we can use context.module

Customize

We can provide options for each slider bean rendered on page.

  1. In my_module.info, add dependencies[] = at_slider
  2. Create `/path/to/my_module/config/slider_options.yml
  3. Define slider_options.yml like this:
options:
    default:
        speed: 600
        manualSpeed: 100
        # If you want customize HTML structure of slider-item, you can define
        # this option
        item-template: '@crom_andy/templates/slider/item-image.html.twig'

jCycle options reference can be found at http://jquery.malsup.com/cycle2/api/#options

Example for slider with pager:

options:
    home-slider:
        pager: '#slider-home-pager'
        wrapper-after: '<div id="slider-home-pager"></div>'

Credits

Started by Andy Truong for GO1.

at_slider's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.