textagroup / countdown
Add a countdown widget to a page
Installs: 97
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 2
Open Issues: 0
Type:silverstripe-module
Requires
- silverstripe/framework: ~3.1
This package is not auto-updated.
Last update: 2024-11-05 04:57:48 UTC
README
Maintainer Contact
- Kirk Mayo (Nickname: textagroup) kirk.mayo@solnet.co.nz
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