How smart are you with JavaScript? You can use the Brandon Kelly CP and JS extension . Then use a little custom javascript to create this functionality. Not perfect, but probably faster than writing custom extensions. Roughly, you would do this:
- Create a group of channel fields and all channels and assign this group to your channel
- To make it easier to use, you need the category selector to be on the same Publish tab as the fields: create your own publication layout for this channel, which moves the Categories field on the Categories tab to the Publish tab "
- Find the channel field ID numbers that you want to hide, as they will be the HTML IDs on the publication page that look like "hold_field_ID #"
- Highlight a category identifier for a category to click to open additional fields. On the Publish page, this category will be displayed in the Categories field with the attribute "value = ID".
- Script time! Go to Extras> Extensions> CSS and JS CSS Options and add some JS to the Custom Javascript field.
Something like that:
$(document).ready(function() {
In the click handler, you may need one more logic to make sure that the fields are displayed only when the checkbox is selected (among other things), but that the main idea.
source share