Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default {
total: 0,
isLoading: true,
currentLanguageId: Shopware.Context.api.languageId,
term: '',
};
},

Expand Down Expand Up @@ -89,6 +90,11 @@ export default {
}
},

onSearch(term) {
this.term = term;
this.getList();
},

getList() {
this.isLoading = true;
const criteria = new Criteria(this.page, this.limit);
Expand All @@ -101,6 +107,11 @@ export default {
if (this.categoryId) {
criteria.addFilter(Criteria.equals('blogCategories.id', this.categoryId));
}

if (this.term) {
criteria.setTerm(this.term);
}

return this.blogEntryRepository.search(criteria, Shopware.Context.api).then((result) => {
this.total = result.total;
this.blogEntries = result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
<sw-language-switch @on-change="changeLanguage" />
</template>

{% block werkl_blog_list_search %}
<template #search-bar>
<sw-simple-search-field
v-model:value="term"
variant="inverted"
size="small"
:placeholder="$tc('werkl-blog.general.placeholderSearchBar')"
@update:value="onSearch"
/>
</template>
{% endblock %}

{% block werkl_blog_list_smart_bar_actions %}
<template #smart-bar-actions>
{% block werkl_blog_list_smart_bar_actions_add %}
Expand Down