I just added one more attribute to form_radios function - separator. The default value is '<br />', as before. I use it for example to layout the buttons in row instead in column.

I thought this little change could be useful.

The patch is working against HEAD right now.

CommentFileSizeAuthor
#7 form_radios_separator_0.patch1.38 KBUwe Hermann
form_radios_separator.patch1.38 KBAnonymous (not verified)

Comments

dries’s picture

I wonder whether this should be a theme issue or not ... and with that in mind, whether this would be the proper solution.

Steven’s picture

It might be useful to arrange list then horizontally yes... but then I'm wondering if it might not be best to style form_radios as a regular HTML list with list items. Then you can apply 'float: left;' or 'display: inline;' to them.

mph@private.prihoda.net’s picture

I think that it's definitely not a theme issue - the decision how buttons should be laied out in larger forms should be up to the developer, theme knows usually nothing about usability (well, usually the dev doesn't know as well, but...)

Making it a list seems as a good alternative to me - I'll explore it, I'm still not sure about good support for styling this elements in different browsers, but I like the idea. I'll submit new patch if it works.

Steven’s picture

I don't think mph is around anymore. Still I think formatting radio/check lists as actual lists is a good idea. Setting back to active.

marceloverdijk’s picture

Hi,

I think the original proposed change was nice.
At least better than the original code because a
was printed for each button.

I'm wondering about the status of this patch/proposed chaged, because it's not included in the current cvs version downloadable.

Regards,
Marcel

jimt’s picture

I agree that having the ability to specify separators other than br would be very handy. A $separator argument defaulting to br looks like a painless way to achieve this while maintaining backwards compatibility.

Uwe Hermann’s picture

Status: Active » Needs review
StatusFileSize
new1.38 KB

I like it. Here's an updated patch for HEAD.

Crell’s picture

Status: Needs review » Needs work

Based on old form code, not new Form API.

Personally I'd rather see this handled with the list-item method, but either way the latest patch doesn't work anymore. :-)

Jaza’s picture

Version: x.y.z » 4.6.x-dev
Status: Needs work » Closed (fixed)

This patch is only relevant for 4.6 (pre-FAPI), which is no longer supported. Closing.