Added ability to have an before each so as to allow linking to a page#foo when directing users to upload their user picture or whatever. I think this is really important for usability as the user account page can get rather long, and for the old folks who can't use the Internet that well, this is helpful.

Also, included a change to the user.module to write out a named anchor for the user picture as an example.

CommentFileSizeAuthor
common_anchor_names.patch1.02 KBRobRoy

Comments

RobRoy’s picture

killes@www.drop.org’s picture

Version: 4.6.1 » x.y.z
Component: drupal.module » base system
gordon’s picture

Status: Needs review » Needs work

-1

The addition of the anchor doesn't seem to be very drupalish. This IMO would be better if it was a separate function so that if can be used in more places than just the form_group. maybe a drupal_anchor() that can be called.

The example that has been provided, with the inclusion of the expanding and collapsing groups is no longs nessecary as they entire page may not be more than a single page so the browser will not be able to move anywhere.

Steven’s picture

Status: Needs work » Active

You don't need an anchor tag or a name attribute to scroll the page to a particular item, you can use the id attribute and on any element. This has been true since HTML4:
http://www.w3.org/TR/html4/struct/global.html#adef-id

This works for me in IE (6), Firefox and Opera. So the patch should instead be to pass HTML attributes to form_group(), so you can supply an id.

RobRoy’s picture

Steven, that sounds fine.

So you think there should be an attributes array for both the fieldset and the legend? The fieldset definitely needs the id so when you go to page.php#id it shows the group label -- I think that's important.

Let me know and I'll submit a patch for it.

RobRoy’s picture

Version: x.y.z » 4.6.0
Status: Active » Closed (duplicate)

This is my old issue and pretty old. The new FAPI allows you to add attributes to form items, including fieldsets.

For an automated solution, let's continue in http://drupal.org/node/49103.