Make placeholder and title properties configurable in SearchBlock

Created on 2 April 2010, over 14 years ago
Updated 22 June 2024, 5 months ago

Problem/Motivation

Setting a placeholder text to prompt users to use the <input> of a search block is a common end-user facing task. However, right now, the only way to set such value is through a hook.

It would be ideal to have an option in the search block configuration to change this value and the similarly used title.

Steps to reproduce

Add a Search Block to any Drupal site. The "placeholder" text can't be changed without coding a hook or other custom solution.

Proposed resolution

Add the mentioned options as configurable items in the block configuration itself.

Remaining tasks

  • Get usability team blessing
  • Write change record
  • Add config upgrade path

User interface changes

Would add two new configurable items to Search Blocks

API changes

NA

Data model changes

NA

Release notes snippet

Search Blocks now provide an option to configure the placeholder and title text for the query input.

✨ Feature request
Status

Needs work

Version

11.0 πŸ”₯

Component
SearchΒ  β†’

Last updated 7 days ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡¬πŸ‡§United Kingdom Pimmy

Live updates comments and jobs are added and updated live.
  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

  • Needs usability review

    Used to alert the usability topic maintainer(s) that an issue significantly affects (or has the potential to affect) the usability of Drupal, and their signoff is needed. When adding this tag, make it easy to review the issue. Make sure the issue summary describes the problem and the proposed solution. Screenshots usually help a lot! To get sign-off on issues with the "Needs usability review" tag, post about them in the #ux channel on Drupal Slack, and/or attend a UX meeting to demo the patch and get direct feedback from designers/UX folks/product management on next steps. If an issue represents a significant new feature, UI change, or change to the general "user experience" of Drupal, use Needs product manager review instead. See the scope of responsibilities for product managers.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave
    The current search block has a hardcoded title attribute ("Enter the terms you wish to search for") but no placeholder attribute.

    This could probably actually be made configurable on the block configuration form itself

    Seems like the path forward that would need to happen

    Will need test coverage as well when implemented.

  • First commit to issue fork.
  • πŸ‡΅πŸ‡ͺPeru diegoe Lima, PerΓΊ

    diegoe β†’ changed the visibility of the branch 760182_diegoe_search-block-title-and-placeholder to hidden.

  • Pipeline finished with Failed
    6 months ago
    Total: 604s
    #182375
  • Pipeline finished with Failed
    6 months ago
    Total: 596s
    #182413
  • Pipeline finished with Success
    6 months ago
    Total: 541s
    #182432
  • Status changed to Needs review 6 months ago
  • πŸ‡΅πŸ‡ͺPeru diegoe Lima, PerΓΊ

    Attached MR adds the option of configuring the title and placeholder HTML properties for search block forms.

    A new test is included and as many dependents as I noticed (umami, olivero, help) have been updated.

  • Status changed to Needs work 6 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Believe issue summary still needs to be updated, recommend using standard issue template.

    New configuration will require an upgrade path for existing sites. Also a change record.

    For the new changes probably will need usability team to take a look

    Thanks

  • πŸ‡΅πŸ‡ͺPeru diegoe Lima, PerΓΊ

    Updated summary and removed corresponding tag.

    How would I go about getting the usability team's review on this?

  • Pipeline finished with Success
    5 months ago
    Total: 657s
    #205242
Production build 0.71.5 2024