I'm using only the country dropdown and I have this large encasing around it. I want it to look like a normal field. How do I remove the extra stuff like the fieldset and the title and other things? Thanks.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ptmkenny’s picture

This is not specifically an issue with the location module. Although it's a little technical, you can use the solution suggested here.

apmsooner’s picture

Issue summary: View changes
Status: Active » Needs review

This method works for me in a custom module and doesn't appear to cause any issues:

** Uncommment the dpm function if devel is enabled and can see output of additional options.

function my_module_location_element_alter(&$element) {
    //dpm($element);
    unset($element['#theme_wrappers']);
}

Setting status to needs review just for confirmation if this is the recommended way...

apmsooner’s picture

Category: Support request » Feature request

Could #2 be considered a valid feature request for a simple setting in the location field settings for cases such as where only one or 2 fields are collected from the location?

podarok’s picture

Version: 7.x-5.x-dev » 7.x-3.x-dev

moving to proper branch. 5.x is unsupported.

podarok’s picture

Status: Needs review » Active

also I see nothing to review within current issue

apmsooner’s picture

@podarok,
#2 was posted as solution to the original request. If this is suggested way of doing this... can it be added to documentation for module? I will add the documentation page myself if so.... i think it would be helpful to the community for proper theming.

#3 was requested for review as a feature request to alleviate custom coding proposed in #2. A simple checkbox setting in the location ui would be helpful to remove the default fieldset wrappers in my opinion. Theres extra css corresponding with the default fieldset provided by the module that doesn't conform to core field styling (ie; label and field widths for example). The default css also doesn't play well with mobile sites and always has to be overidden to display on smaller devices. An option to remove the default fieldset wrapper would take care of that issue.

martini9011’s picture

I created a patch that adds a Field display settings fieldset to the location field edit form, in which you can choose to show or hide the fieldset.

I used the element_alter() function as per #2, but only targeted the fieldset theme wrapper, in case any other theme wrappers get added.

Let me know if everything works for you guys.

martini9011’s picture

Status: Active » Needs review
martini9011’s picture

Seems like my diff caught some unnecessary changes... Cleaner patch attached.

legolasbo’s picture

Retesting to see if the patch still applies correctly

Ronino’s picture

Patch #9 works for me but I want to suggest some changes.

First it might be useful in some cases to have this as an instance setting instead of a field setting.

Second, if it remains a field setting, it should be put into the existing "display settings" fieldset, with the checkbox under a subheading "Theming" or something like that. Otherwise it's confusing to have an extra fieldset labeled "field display settings".