Is there a way to put a label after its field? I don't see the option show up on the edit component page.

Looking in webform/includes/webform.components.inc line 459, if I add
'after' => t('After'),
in that #options array, it properly puts the label after the field, so it seems like it should be listed there.

Comments

danchadwick’s picture

Category: Bug report » Feature request

This was never supported, which isn't to say that it couldn't be. That's assuming someone writes a patch and tests it on every possible component. And then there's the affect on tokens, including the [submissions:values] token.

Patches welcome.

j_s’s picture

Ah, gotcha. I assumed it was supported since webform.module has a theme_webform_element() function that already has the functionality for case 'after' on line 3592 (probably copied in from Drupal's theme_form_element() function).

danchadwick’s picture

Status: Active » Closed (won't fix)

I'm going to close this as I don't anticipate a patch. But feel free to reopen with one.

j_s’s picture

StatusFileSize
new550 bytes

Adding a patch here.

j_s’s picture

Status: Closed (won't fix) » Active
pcate’s picture

I tested the patch if it worked fine. This is a nice option to have available.

danchadwick’s picture

Surprised that none the components need theming changes to make this work. @PCate: aby "worked fine", are you saying that you created one of every possible component, set them to after, and confirmed that they rendered correctly? What about tokens?

j_s’s picture

StatusFileSize
new553 bytes

Nicely, there's code already in Drupal/Webform for displaying the title after. It just needs to be added as an option. Attached an updated patch to account for line changes.

I tested on components Date, Email, File, Number, Select (including listbox, radio, checkboxes), Textarea, Textfield, and Time, which all worked fine. Drupal has code (defined in theme_form_element_label) to add the class 'option' when the label comes after, which removes bold and tries to inline the label.

liam morland’s picture

Version: 7.x-4.8 » 7.x-4.x-dev
Status: Active » Needs review

Thanks for the patch. It would be great to get a test with this patch.

liam morland’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.