2017 © Pedro Peláez
 

craft-plugin craft-elementoptions

This is a generic Craft CMS plugin

image

timkelty/craft-elementoptions

This is a generic Craft CMS plugin

  • Monday, August 14, 2017
  • by timkelty
  • Repository
  • 3 Watchers
  • 36 Stars
  • 194 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 6 Versions
  • 3 % Grown

The README.md

ElementOptions plugin for Craft CMS

ElementOptions fieldtypes function similar to the native Checkboxes fieldtypes, with the addition of a selected element to each option. Each element type is supported with it's own fieldtype: Assets, Users, Entries, and Categories., (*1)

Screenshot, (*2)

Why

The intital need for this plugin was to create a "layout selection" field. While a radio buttons field would do the trick, we wanted to be able to show a selectable image instead of a checkbox and text., (*3)

The most applicable element type is Assets, as it allows you to create a field where users can select from a pre-defined set of Assets., (*4)

Screenshot, (*5)

Installation

  • Via Composer: composer require timkelty/craft-elementoptions
  • Git: git clone https://github.com/timkelty/craft-elementoptions.git craft/plugins/elementoptions
  • Download & unzip the into craft/plugins/elementoptions directory

ElementOptions works on Craft 2.4.x and Craft 2.5.x., (*6)

Settings

Screenshot, (*7)

See Craft Docs for Checkboxes Fields / Settings., (*8)

  • Limit the number of selectable options
  • Select an element for each option, and how that element will be displayed (thumbnails, label, checkbox)
  • Option Label and Value may contain tags that reference the selected entry, such as {title} or {slug}. This can be useful if you want the label/value to change with element, and vice-versa.

Templating

See Craft Docs for Checkboxes Fields / Templating., (*9)

  • option.element is available. It will return an ElementCriteriaModel.
<ul>
    {% for option in entry.elementOptionsFieldHandle %}
        <li>{{ option.element.first().title }}</li>
    {% endfor %}
</ul>

The Versions

14/08 2017

dev-import-base

dev-import-base

This is a generic Craft CMS plugin

  Sources   Download

The Requires

 

24/05 2016

dev-master

9999999-dev

This is a generic Craft CMS plugin

  Sources   Download

The Requires

 

24/05 2016

1.0.3

1.0.3.0

This is a generic Craft CMS plugin

  Sources   Download

The Requires

 

04/05 2016

1.0.2

1.0.2.0

This is a generic Craft CMS plugin

  Sources   Download

The Requires

 

12/04 2016

1.0.1

1.0.1.0

This is a generic Craft CMS plugin

  Sources   Download

The Requires

 

12/04 2016

1.0

1.0.0.0

This is a generic Craft CMS plugin

  Sources   Download

The Requires