4

I'm creating a Matrix to allow users to upload images. One of the fields I want to put is a radio button for "Set as default image". That means each row in the Matrix will have a radio button.

Problem: there can only be one default image selected from the list of images. So, if one radio is selected, the other radio needs to be unselected. Is there a way to do this without using a JS solution?

2 Answers 2

5

There are two available fieldtypes specifically for this purpose. They both work great:

  • MX Lone Star. It has the added advantage of working not only across rows, but across columns, too.
  • Matrix Radio Group. By Pixel & Tonic. This one is not on Devot:ee and might only be
    described here.
1
  • I only looked at Matrix Radio Group. Seems to have done the job. Why on earth is this so obscurely placed? Glad you knew about this one. Thanks! Commented Dec 15, 2012 at 2:46
0

I know this question has already been answered and even though my contribution serves a different purpose, this Q&A result was one of the first to display when I was searching for a solution for radio options within a Matrix cell type. I hope this will help anyone looking for a similar solution.

I found Field Pack (http://devot-ee.com/add-ons/field-pack) by Pixel & Tonic to be a great solution. It is fully compatible with Matrix.

After installing the Fieldtypes you want to use, select "Field Pack - Radio Buttons" as the Matrix Cell Type and then list the radio options on separate lines:

enter image description here

Then when creating the content, this is how the Radio options display:

enter image description here

The selected option will display exactly as you have entered it on the front-end:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.