When you only need 1 location for a node, the Location(s) box is not necessary.

Location(s)
| Location
| | Address Information

If the "Maximum number of locations allowed for this type" and "Default number of location forms" both equal 1, can we remove the display of the "Location(s)" box?

Comments

geodaniel’s picture

I'd add a +1 for this too... it looks a little strange having the boxes nested like that when there's only one location

csc4’s picture

It would also be really nice if it only added the plural when needed -

ie Location

rather than Location(s)

geodaniel’s picture

StatusFileSize
new1.71 KB

There's a patch here that changes Location(s) to Location or Location depending on the number of location forms available - it doesn't flatten the boxes for a single location though.

csc4’s picture

You're a marvel! Thank you so much!

Any idea if/when these will make it into core as they're really useful and it would be great if people could download the whole patched module.

geodaniel’s picture

Status: Active » Needs work

My solution was only a partial one, so I'm not sure it's ready to be applied to the module yet. As for when... Ankur's a busy guy, and it depends on his schedule. We can help him out by making sure that patches are pretty much ready to go in though, to make it easier to review.

geodaniel’s picture

Initial patch committed to HEAD and DRUPAL-5 branch - will backport to 4.7 too. I still haven't tackled the removal of one of the boxes when there is only one location though.

geodaniel’s picture

Title: Eliminate Location(s) Box when MaxLoc and Default#Forms = 1 » Remove duplicate location box when only adding one location

Initial patch committed to DRUPAL-4-7 branch too. Leaving this ticket open for the other half of it, to remove the duplicate boxes when only adding one location.

ankur’s picture

Status: Needs work » Active

Setting to active so status it doesn't get listed as 'patch' in queue list

jo1ene’s picture

Title: Remove duplicate location box when only adding one location » Several fixes for location entry/edit box

+1 for fixing boxes

Where's the "add another location" in the edit form?
There is also an issue with alignment. It just looks terrible.

geodaniel’s picture

Title: Several fixes for location entry/edit box » Remove duplicate location box when only adding one location

Marked http://drupal.org/node/131485 as dup of this

colan’s picture

Status: Active » Closed (duplicate)

I'm marking this as a duplicate of http://drupal.org/node/160443 because that one's got a patch.