Code Monkey home page Code Monkey logo

expressionengine-year-options's Introduction

Description

ExpressionEngine plugin which generates options for select fields starting from current year.

Installation

Copy the "year_options" folder to your /system/expressionengine/third_party folder.

Usage

Use {exp:year_options years="" value_prefix="" text_prefix=""} to output year options.

The years parameter indicates the number of years in addition to this year you'd like to output, and is required. Both the value_prefix and test_prefix paramaters are optional.

Example 1

<select>
    <option value="">Year</option>
    {exp:year_options years="5"}
</select>

This would return:

<select>
    <option value="">Year</option>
    <option value="2014">2014</option>
    <option value="2013">2013</option>
    <option value="2012">2012</option>
    <option value="2011">2011</option>
    <option value="2010">2010</option>
    <option value="2009">2009</option>
</select>

Example 2

<select>
    <option value="">Year</option>
    {exp:year_options years="5" value_prefix="ABC-" text_prefix="XYZ-"}
</select>

This would return:

<select>
    <option value="">Year</option>
    <option value="ABC-2014">XYZ-2014</option>
    <option value="ABC-2013">XYZ-2013</option>
    <option value="ABC-2012">XYZ-2012</option>
    <option value="ABC-2011">XYZ-2011</option>
    <option value="ABC-2010">XYZ-2010</option>
    <option value="ABC-2009">XYZ-2009</option>
</select>

expressionengine-year-options's People

Watchers

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