Giter Club home page Giter Club logo

wp-field-status's Introduction

What?

Silly little plugin to store field status in config settings and expose them via shortcodes.

Installation

Install in wordpress plugins dir.

Configuration/Updating Field Status

In the dashboard, go to Settings => Cardiff Soccer Field Status Menu

Click on Open/Closed as appropriate. Add an optional comment (currently just used as a title/popup in the open/closed span).

Shortcode

You can insert current field status content using the shortcode:

   [field-status [fmt="(brian|ul)"] [field=("berkich|ada|csp")]]

Formatting

The fmt parameter controls formatting:

  • brian will format the field status in a manner consistent with current formatting on the site so that: [field-status fmt="brian"] results in something like the following:
<div class= "f-wrap">
  <dl>Cardiff Elementary (Berkich)</dl>
  <dt>South: <span title="Closing Dec 21st" class="open">Open</span></dt>
  <dt>North: <span title="Opening January 15th" class="closed">Closed</span></dt>
  <dl>Ada Harris Elementary</dl>
  <dt>East: <span title="Opening Feb 1st" class="closed">Closed</span></dt>
  <dt>West: <span title="Opening Feb 1st" class="closed">Closed</span></dt>
  <dl>Cardiff Sports Park (Lake)</dl>
  <dt>Upper: <span title="Unavailable to Cardiff Soccer until late spring" class="closed">Closed</span></dt>
  <dt>Lower: <span title="Unavailable to Cardiff Soccer until late spring" class="closed">Closed</span></dt>
</div>
  • ul will format the field status using dl/ul nesting, so that: [field-status fmt="ul"] results in something like the following:
<dl class= "f-wrap">
  <dt>Cardiff Elementary (Berkich)</dt>
  <dd>
    <ul>
      <li>South: <span title="Closing Dec 21st" class="open">Open</span></li>
      <li>North: <span title="Opening January 15th" class="closed">Closed</span></li>
    </ul>
  </dd>
  <dt>Ada Harris Elementary</dt>
  <dd>
    <ul>
      <li>East: <span title="Opening Feb 1st" class="closed">Closed</span></li>
      <li>West: <span title="Opening Feb 1st" class="closed">Closed</span></li>
    </ul>
  </dd>
  <dt>Cardiff Sports Park (Lake)</dt>
  <dd>
    <ul>
      <li>Upper: <span title="Unavailable to Cardiff Soccer until late spring" class="closed">Closed</span></li>
      <li>Lower: <span title="Unavailable to Cardiff Soccer until late spring" class="closed">Closed</span></li>
    </ul>
  </dd>
</dl>

Displaying only a single field

The field parameter can be used to limit the output to the sides of a specific field. E.g., to display the current status of Berkich (with default formatting). Fields recognized are:

  • berkich
  • ada
  • csp

The shortcode

[field-status field="berkich"]

would output the following using the default formatting:

<ul>
  <li>South: <span title="Closing Dec 21st" class="open">Open</span></li>
  <li>North: <span title="Opening January 15th" class="closed">Closed</span></li>
 </ul>

or the following using brian formatting:

<dt>South: <span title="Closing Dec 21st" class="open">Open</span></dt>
<dt>North: <span title="Opening January 15th" class="closed">Closed</span></dt>

wp-field-status's People

Contributors

crindt avatar

Watchers

 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.