This patch adds ids to the location divs in the node edit form to allow for easier theming via css.

We could tweak the names of the IDs, but I think this is mostly valid.

Comments

geodaniel’s picture

Forgive me if I'm asking a silly question, but what's the benefit of using underscores over dashes for the ids? Are normal dashes not valid? Just curious :)

nevets’s picture

Bad use od id's, should be css class. An id should be only used if there can/is only one of something. Using an id as this patch does would make it hard to include two locations on the same form (the html would not validate, css styling might fail and any assocated javascript will cause odd results). And yes there are reason to have more than one location on a form. In general, any id's assigned to a form field should be unique (ifor example reflect the name of the field).

Tobias Maier’s picture

-1 for ids
+1 for usefull classes

greggles’s picture

Status: Needs review » Needs work

So, my diff sucked anyway, but you all got the idea.

For those who are promotingclasses, is the appropriate way something like

  '#prefix' => '<div class="container-inline location-additional">',

?

nevets’s picture

Yes that would be an appropriate way to add more classes.

greggles’s picture

Version: 4.7.x-1.x-dev » 6.x-3.x-dev
StatusFileSize
new3.27 KB

Here's a patch for HEAD - I think it probably makes the most sense to leave them the same for 4.7 and only change this in HEAD.

greggles’s picture

Status: Needs work » Needs review

Also, the patch uses classes as nevets and Tobias Maier suggested.

The names come mostly from the field name (or the function name in the case of the latlon which are in the same div). I used underscore consistently since some fields contain underscores - but that seems mostly like a preference thing to me.

greggles’s picture

one more change - I forgot to update the title.

greggles’s picture

Title: add ids to div for easier theming » add classes to div for easier theming
Tobias Maier’s picture

hello greggles,

first of all thank you for your new patch.

I thought a little bit about this and came to the idea of using the hcard-Microformat or the geo-Microformat for displaying addresses.
What do you think about this?

greggles’s picture

Do those apply to input? My patch is only for the inputting side of location, not the output. But certainly we could investigate using those as the default styles in the theme section.

I think that should live in a different issue, personally.

Tobias Maier’s picture

oh sorry i over read that this issue only affects the node edit form...

I moved my suggestion to an own issue:
http://drupal.org/node/99191

bdragon’s picture

Status: Needs review » Closed (won't fix)

Please open a new issue if this is still a problem. ;)