The patch adds the capability to configure a placeholder for exposed filters.

Todo: add an option only for text fields.
Need help to improvement.

Option form

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

m.lebedev created an issue. See original summary.

m.lebedev’s picture

m.lebedev’s picture

Issue summary: View changes
chrisgross’s picture

Re-rolled patch for latest 3.3+dev

mikeker’s picture

Status: Active » Needs review
Issue tags: -placeholder, -exposed filters

When there's a solution offered, you should set the issue to Need review so that maintainers realize there's something to look at.

Thank you for your contributions. At this point, my focus is on getting a D8 version out the door so I won't be looking at D7 feature requests/additions for a while.

dflitner’s picture

#4 works for me on BEF version 7.x-3.4. Thank you for the patch!

ykyuen’s picture

#4 works on BEF 7.x-3.6 too

Topplestack’s picture

#4 wouldn't apply for me, so I rerolled it for 3.x-dev

mibfire’s picture

I don't think label should be disabled. There should be an option if user wants to show it. Why do i have "Custom text of placeholder" option if label is always removed?

mibfire’s picture

I had to fix bef-placeholder_support-2560321-8.patch because it doesn't work if views is not saved after module is patched. This way all label will disappear because $options['more_options']['placeholder'] doesn't exist.

So this:

if ($options['more_options']['placeholder'] != 'disable') {

has to be

if (isset($options['more_options']['placeholder']) && $options['more_options']['placeholder'] != 'disable') {

Patch is attached.

NWOM’s picture

Is there an advantage to using this patch over #2219249: Move label to input value or placeholder? I used that successfully for a few years on an older project. Today I was going to re-apply it on another project before running into the patch in this issue. After determining which one is better, we should mark one as a duplicate.

Neslee Canil Pinto’s picture

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

Hi, there will be no more future development for 7.x branch. If you see this issue in 8.x, feel free to file an issue. Closing this as Closed(wont fix).

NWOM’s picture

For a D7 fix, I suggest potentially using the Views Advanced Labels module. The only catch is that if you only want the advanced label to be shown as a placeholder, you need to clear the regular label field every time you save/alter the filter.