Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#9 | hide-fieldset-wrapper-1481754-9.patch | 1.36 KB | martini9011 |
| |||
#7 | hide-fieldset-wrapper-1481754-7.patch | 2.58 KB | martini9011 |
|
Comments
Comment #1
ptmkenny CreditAttribution: ptmkenny commentedThis is not specifically an issue with the location module. Although it's a little technical, you can use the solution suggested here.
Comment #2
apmsooner CreditAttribution: apmsooner commentedThis 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.
Setting status to needs review just for confirmation if this is the recommended way...
Comment #3
apmsooner CreditAttribution: apmsooner commentedCould #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?
Comment #4
podarokmoving to proper branch. 5.x is unsupported.
Comment #5
podarokalso I see nothing to review within current issue
Comment #6
apmsooner CreditAttribution: apmsooner commented@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.
Comment #7
martini9011 CreditAttribution: martini9011 commentedI 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.
Comment #8
martini9011 CreditAttribution: martini9011 commentedComment #9
martini9011 CreditAttribution: martini9011 commentedSeems like my diff caught some unnecessary changes... Cleaner patch attached.
Comment #10
legolasboRetesting to see if the patch still applies correctly
Comment #11
Ronino CreditAttribution: Ronino as a volunteer commentedPatch #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".