Skip to content
Snippets Groups Projects

Issue #3347736: Create new SDC component for Olivero (header-search)

Open Issue #3347736: Create new SDC component for Olivero (header-search)
3 unresolved threads
3 unresolved threads

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
34 'block-search-narrow',
35 ]
36 %}
37 <div{{ attributes.addClass(classes) }}>
38 {{ title_prefix }}
39 {% if label %}
40 <h2{{ title_attributes }}>{{ label }}</h2>
41 {% endif %}
42 {{ title_suffix }}
43 {% block content %}
44 <div{{ content_attributes.addClass('content') }}>
45 {{ content }}
46 </div>
47 {% endblock %}
48 </div>
1 {{ include('olivero:header-search-narrow') }}
  • Let's add with_context = false to avoid passing additional stuff.

    Suggested change
    1 {{ include('olivero:header-search-narrow') }}
    1 {{ include('olivero:header-search-narrow', with_context = false) }}
  • Please register or sign in to reply
  • 42
    43 {#
    44 Add tabindex=“-1” to prevent Safari from closing search bar when the submit button is clicked with a mouse.
    45 @see https://www.drupal.org/project/drupal/issues/3269716
    46 @see https://bugs.webkit.org/show_bug.cgi?id=229895
    47 #}
    48 <div{{ content_attributes.addClass('block-search-wide__wrapper').setAttribute('data-drupal-selector', 'block-search-wide-wrapper').setAttribute('tabindex', '-1') }}>
    49 <div class="block-search-wide__container">
    50 <div class="block-search-wide__grid">
    51 {{ content }}
    52 </div>
    53 </div>
    54 </div>
    55 {% endblock %}
    56 </div>
    1 {{ include('olivero:header-search-wide') }}
  • 133 133 }
    134 134 }
    135 135
    136 if ($variables['base_plugin_id'] === 'search_form_block') {
    137 if ($region === 'primary_menu') {
    138 $variables['#attached']['library'][] = 'olivero/search-narrow';
    139 $variables['content']['actions']['submit']['#theme_wrappers'] = ['input__submit__header_search'];
    140 }
    141 elseif ($region === 'secondary_menu') {
    142 $variables['#attached']['library'][] = 'olivero/search-wide';
    143 $variables['content']['actions']['submit']['#theme_wrappers'] = ['input__submit__header_search'];
    144 }
    136 // @todo can this move to SDC?
    • There are no pre-process in SDC. This is by design. If you need to massage data so your blocks can use the component you defined, a template_preprocess_block is the correct place.

      In general, preprocess is about the template that includes the component, so you can map to the inputs you defined on your component.

      Suggested change
      136 // @todo can this move to SDC?
    • Please register or sign in to reply
  • Ahsan Nazir added 2684 commits

    added 2684 commits

    • 917e9dc1...b6aef35b - 314 commits from branch project:10.1.x
    • b6aef35b...bf4dfeaa - 2360 earlier commits
    • 2e311a8d - Issue #1650198 by apaderno, quietone, jhodgdon, smustgrave: Remove references...
    • 717b02a8 - Issue #3459240 by jurgenhaas, b_sharpe, longwave, quietone: Deprecation...
    • 14669ce1 - Issue #2575253 by jwilson3, Gauravvvv, rachanakamlesh, Balu Ertl,...
    • e700aa81 - Issue #3444740 by ahsannazir, Utkarsh_33, Gauravvvv, Kanchan Bhogade,...
    • 45bcde63 - Issue #3368071 by tstoeckler, longwave: Installing Content Translation module breaks Rest resources
    • 8afa957b - Issue #3459754 by mondrake: Method getMockForAbstractClass() of class...
    • c12636b4 - Issue #3458220 by Sourav_Paul, rroose, Chandansha, smustgrave: Date list...
    • cd35c526 - Port header-search-narrow and header-search-wide to SDC
    • f641e3b0 - CSS specificity fixes
    • fdd9e614 - path updated for media query file and fixed build failure

    Compare with previous version

  • Please register or sign in to reply
    Loading