Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andrewhaine/statamic-accordion-group
Stash groups of fields from long fieldsets away in accordion-style toggle boxes.
https://github.com/andrewhaine/statamic-accordion-group
Last synced: about 1 month ago
JSON representation
Stash groups of fields from long fieldsets away in accordion-style toggle boxes.
- Host: GitHub
- URL: https://github.com/andrewhaine/statamic-accordion-group
- Owner: AndrewHaine
- License: mit
- Created: 2018-11-10T00:33:09.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-27T21:27:48.000Z (almost 6 years ago)
- Last Synced: 2024-05-21T06:17:03.968Z (8 months ago)
- Language: Vue
- Homepage:
- Size: 385 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Statamic Accordion Group
Stash groups of fields from long fieldsets away in accordion-style toggle boxes.
## Installation
To install this fieldtype, download the addon files from the [Statamic marketplace](https://statamic.com/marketplace/addons/accordion-group) and place the `AccordionGroup` folder in your `site/addons` directory. You should then be able to add 'Accordion Group' fields to your fieldsets.
## Setting up fieldsets
You will need to define fieldsets for groups of fields that you wish to place within an accordion group, once a fieldset has been built you can tell you accordion group to use that fieldset, either through the field 'extras' interface or in your yaml.
## Example
In the example below we are storing fields from the 'metadata' fieldset in an accordion group:
```yaml
fields:
metadata:
type: accordion_group
display: Metadata
instructions: Optimize the metadata for this page or post.
child_fieldset: metadata
```![Example metadata field in CP](https://raw.githubusercontent.com/AndrewHaine/statamic-accordion-group/master/docs/img/statamic-accordion-group-cp-xmpl.gif)
## How do I use this in my templates?
In templates the fields contained within accordion groups will be prefixed with the name of the group, for example the `meta_title` field will become `metadata.meta_title`:
```html
{{ if metadata.page_no_index }}{{ /if }}
{{ metadata.meta_title or title }}```
## Nesting?
Yes, but not recommended when your child fieldset contains the parent accordion field.