Download & Extend

Add an option to show help text before field

Project:Drupal core
Version:8.x-dev
Component:forms system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

Hi, I think it would be useful an option on fields' edit page to specify if showing the help text before or after the field value. Now the help text position is fixed below the field (and I can't find any module which adapts it), but in certain situation it helps more if it's above. For example on a subscription checkbox where the explanation is important to be red before checking for accepting.

Edited:
This is a potential duplicate of #314385: Make position of #description configurable. Read there for background discussion.

Comments

#1

Status:active» needs review

I had a look at it and made a kickoff patch for starting work on this. Let's see what the community thinks about this feature and the patch itself. The patch doesn't add the option to the UI yet, but gives the option settings throught hook_element_alter(). Tests needed too.

AttachmentSizeStatusTest resultOperations
field-description-before-1325488-0.patch3.97 KBIdlePASSED: [[SimpleTest]]: [MySQL] 33,761 pass(es).View details | Re-test

#2

#3

I've just installed your patch. It seems not hurting normal behaviour.
So, is next step to add an option to UI ?

#4

Yep. But I'm not sure where this option should remain.

My first thought is another column in admin/structure/types/manage/toc/display, but not sure if this should be a global setting of the field instead.

#5

Status:needs review» needs work

This is an interesting suggestion. I can recall wanting to be able to change this in the past.

Do we necessarily need a UI option for this? I would probably support adding the property to FAPI, but changes to the UI require more deliberation. Maybe we could decide whether to add the property to FAPI first, and then open a followup issue to add a UI option for it?

Also, note that the Drupal 8.x patch will need to be rerolled, because the core directory structure for Drupal 8 has now changed. (For more information, see #22336: Move all core Drupal files under a /core folder to improve usability and upgrades). Of course, we still need tests as well.

If you need help rerolling this patch, you can come to core office hours or ask in #drupal-gitsupport on IRC.

#6

Component:field system» forms system

#7

Patch rerolled.

AttachmentSizeStatusTest resultOperations
field-description-before-1325488-1.patch4.01 KBIdlePASSED: [[SimpleTest]]: [MySQL] 33,987 pass(es).View details | Re-test

#8

Status:needs work» needs review

Let's see if these tests pass.

AttachmentSizeStatusTest resultOperations
field-description-before-1325488-7.patch5.96 KBIdleFAILED: [[SimpleTest]]: [MySQL] 33,993 pass(es), 2 fail(s), and 0 exception(es).View details | Re-test

#9

Status:needs review» needs work

The last submitted patch, field-description-before-1325488-7.patch, failed testing.

#10

Status:needs work» needs review

Fixed the tests. The xpath expressions were wrong in the assertions.

AttachmentSizeStatusTest resultOperations
field-description-before-1325488-8.patch6.29 KBIdlePASSED: [[SimpleTest]]: [MySQL] 34,000 pass(es).View details | Re-test

#11

Status:needs review» needs work

The last submitted patch, field-description-before-1325488-8.patch, failed testing.

#12

Status:needs work» needs review

This seems to be an undeterministic test of statistics failing (see #1346772: StatisticsLoggingTestCase->testLogging() fails with clean URLs in some environments). Retesting.

#13

#14

Please see, http://drupal.org/node/314385

I dont think we should add a UI option for this, I understand the usecase - but its perfectly fine for contrib to start using this first.

#15

This is a potential duplicate of #314385: Make position of #description configurable. Read there for background discussion.

#16

Status:needs review» closed (duplicate)

Duplicate indeed

nobody click here