Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oel 454 search block pattern #8

Merged
merged 13 commits into from
Sep 16, 2021
Merged

Oel 454 search block pattern #8

merged 13 commits into from
Sep 16, 2021

Conversation

timpevi
Copy link

@timpevi timpevi commented Sep 14, 2021

No description provided.

@timpevi timpevi changed the title Oel 454 Oel 454 search block pattern Sep 15, 2021
label: "Action"
description: 'A url for attribute action'
preview: '#'
additional_classes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also add additional classes for the input, the button

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additional classes for the button not available

placeholder:
type: "text"
label: "Search"
preview: "search text"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a field "additional_elements" of type array, in case more elements need to be injected

}
%}
{% endif %}
<form{{ attributes.addClass('search-form', 'search-block-form', additional_classes) }} action="{{ url }}">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a attributes array

{% if attributes is empty %}
  {% set attributes = create_attribute() %}
{% endif %}

start adding the classes, action to it, this way if the pattern sends more then the scenario is covered

{#
/**
* @file
* Default theme implementation for a 'form' element.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Default theme implementation for a 'form' element.
* Default theme implementation for a 'search form' composition.

'label': button_label,
'type': 'submit',
'icon': _icon,
'icon_position': 'after'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make the icon position configurable

Copy link
Contributor

@Maxfire Maxfire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@drishu drishu merged commit a0304b2 into 1.x Sep 16, 2021
@drishu drishu deleted the OEL-454 branch September 16, 2021 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants