statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
31 stars 1 forks source link

Add a description field to radio field type #954

Closed stephenmeehanuk closed 1 year ago

stephenmeehanuk commented 1 year ago

Hi,

I'd like to replicate this Tailwind radio layout:

Screenshot 2023-02-27 at 18 04 04

It'd be helpful if there was a way to add an optional description to each key in the options array.

aerni commented 1 year ago

I don't think adding an optional description to the fieldtype is a good idea. It would work in your simple example, but you might have more complicated layouts with more data than a simple description that wouldn't work that way:

CleanShot 2023-03-15 at 10 04 06@2x

I think the best way to go about this issue is to create a collection or global with the data you need and render that dynamically in your template. That's how I do it.

stephenmeehanuk commented 1 year ago

Thanks for the suggestion. I think for my problem, I might be able to get away with making the description part of the view template. If poss, I'd like to try and keep everything in forms.