Coder Social home page Coder Social logo

textagroup-countdown's Introduction

SilverStripe Countdown Widget

Maintainer Contact

Requirements

  • SilverStripe 3.1

Documentation

Adds a countdown widget to a SilverStripe page widget

Installation

composer require "textagroup/countdown"

Setup

To setup a countdown timer the first thing to do is to apply the CoundownWidgetExtension to the page object.

This can be setup in the config yml file as per the example below which will add it to all pages

Page:                                                                           
  extensions:                                                                   
    - CountdownWidgetExtension 

or alternatively you can apply the extension through some PHP code

Member::add_extension('MyMemberExtension');

This will add a countdown tab to the page in the CMS where you can set the Countdown date and the format of the countdown.

Then you need to setup where you want the countdown to appear by adding the the variable $Countdown to the relevant SilverStripe template.

<div class="main" role="main">                                                  
        <div class="inner typography line">                                     
                $Countdown                                                      
                $Layout                                                         
        </div>                                                                  
</div>  

This will add a div or span to your page with a Countdown timer you can then style the div or span with CSS via the relavant class which defaults to CountdownClock but can be amended via the CMS you can also amend the deafult element ID which defaults to clock

See the following page for examples and information of the jQuery module used

Functionality

This module adds a countdown timer to a SilverStripe page and a date field to the cms section for the page which is used to set the countdown date

##TO DO

  • Testing
  • Maybe more countdown clock styles
  • Internationalisation

textagroup-countdown's People

Contributors

textagroup avatar leapfrognz avatar

Watchers

James Cloos avatar helpfulrobot 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.