{"id":18383081,"url":"https://github.com/timkelty/craft-elementoptions","last_synced_at":"2025-04-06T23:32:05.760Z","repository":{"id":57069928,"uuid":"55965783","full_name":"timkelty/craft-elementoptions","owner":"timkelty","description":"Craft CMS Plugin: Checkbox Selection + Elements","archived":false,"fork":false,"pushed_at":"2017-08-14T16:20:52.000Z","size":979,"stargazers_count":35,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-22T09:04:05.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timkelty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-11T11:12:49.000Z","updated_at":"2023-01-16T00:40:55.000Z","dependencies_parsed_at":"2022-08-24T14:54:19.579Z","dependency_job_id":null,"html_url":"https://github.com/timkelty/craft-elementoptions","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkelty%2Fcraft-elementoptions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkelty%2Fcraft-elementoptions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkelty%2Fcraft-elementoptions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timkelty%2Fcraft-elementoptions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timkelty","download_url":"https://codeload.github.com/timkelty/craft-elementoptions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247569124,"owners_count":20959758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T01:09:59.182Z","updated_at":"2025-04-06T23:32:03.389Z","avatar_url":"https://github.com/timkelty.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ElementOptions plugin for Craft CMS\n\nElementOptions fieldtypes function similar to the native [Checkboxes](https://craftcms.com/docs/checkboxes-fields) fieldtypes, with the addition of a selected element to each option.\nEach element type is supported with it's own fieldtype: Assets, Users, Entries, and Categories.\n\n![Screenshot](resources/img/screenshots/field-input.png)\n\n## Why\nThe intital need for this plugin was to create a \"layout selection\" field. While a [radio buttons](https://craftcms.com/docs/radio-buttons-fields) field would do the trick, we wanted to be able to show a selectable image instead of a checkbox and text.\n\nThe 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.\n\n![Screenshot](resources/img/screenshots/field-input-2.png)\n\n## Installation\n- Via Composer: `composer require timkelty/craft-elementoptions`\n- Git: `git clone https://github.com/timkelty/craft-elementoptions.git craft/plugins/elementoptions`\n- Download \u0026 unzip the into `craft/plugins/elementoptions` directory\n\nElementOptions works on Craft 2.4.x and Craft 2.5.x.\n\n## Settings\n![Screenshot](resources/img/screenshots/field-settings.png)\n\nSee [Craft Docs for Checkboxes Fields / Settings](https://craftcms.com/docs/checkboxes-fields#settings).\n\n- Limit the number of selectable options\n- Select an element for each option, and how that element will be displayed (thumbnails, label, checkbox)\n- **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.\n\n### Templating\nSee [Craft Docs for Checkboxes Fields / Templating](https://craftcms.com/docs/checkboxes-fields#templating).\n\n- `option.element` is available. It will return an `ElementCriteriaModel`.\n\n```html\n\u003cul\u003e\n    {% for option in entry.elementOptionsFieldHandle %}\n        \u003cli\u003e{{ option.element.first().title }}\u003c/li\u003e\n    {% endfor %}\n\u003c/ul\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkelty%2Fcraft-elementoptions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimkelty%2Fcraft-elementoptions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimkelty%2Fcraft-elementoptions/lists"}