andrewhaine / statamic-accordion-group Goto Github PK
View Code? Open in Web Editor NEWStash groups of fields from long fieldsets away in accordion-style toggle boxes.
License: MIT License
Stash groups of fields from long fieldsets away in accordion-style toggle boxes.
License: MIT License
Thanks for creating this addon. I have used it in a few projects and it works great to keep the editor clean. However, it seems that using conditionals on fields doesn't work within an accordion group.
For example, I have a simple show of two fields when selecting banner_type
for color and image. Both fields end up showing within the accordion group when it should only be showing one field depending upon the selection made to banner_type
. The same example works fine when loading it via a partial.
Here the example code:
banner_type:
options:
color: Color
image: Image
type: select
default: image
display: Banner Type
banner_color:
type: colorpicker
localizable: true
width: 33
display: Background Color
show_when:
banner_type: color
banner_image:
container: main
folder: /
restrict: false
type: assets
localizable: true
width: 33
display: Background Image
max_files: 1
mode: grid
show_when:
banner_type: image
Image speaks louder than words.
EDIT:
This works flawlessly when it's not in a replicator.
In the screenshot, the accordion_group
is added to a replicator.
add this to line 91.
fieldClasses(field) {
return [
"form-group",
"p-2",
field.type + "-fieldtype",
tailwind_width_class(field.width),
field.classes || ""
];
}
Not sure how we can fix the ReplicatorSet
generated headers without changing the name for instruction and title.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.