Skip to content
Snippets Groups Projects
Commit 01075135 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Remember set filter values

parent f2e97d51
No related branches found
No related tags found
1 merge request!5Feature 5 2 0
......@@ -72,6 +72,12 @@ class ListByCategoryController extends AbstractController {
}
}
// remember selection of the filter values
$selectedTag = $this->tagRepository->findByUid((int) $newsFilter['tag']);
$selectedCategory = $this->categoryRepository->findByUid((int) $newsFilter['category']);
$this->view->assign('selectedTag', $selectedTag);
$this->view->assign('selectedCategory', $selectedCategory);
if (!$filterByCategories) {
$categoryUids = [(int) $GLOBALS['TSFE']->id];
}
......
......@@ -2,13 +2,13 @@
<label for="filter-categories">
<f:translate key="frontend.filter.category" />
</label>
<f:form.select class="sgnews-select form-control" multiple="0" size="1" value="{selectedCategory}"
<f:form.select class="sgnews-select form-control" multiple="0" size="1" value="{selectedCategory.uid}"
property="category" optionLabelField="title" optionValueField="uid" options="{categories}"
id="filter-categories" prependOptionLabel="" prependOptionValue=""/>
<label for="filter-tags">
<f:translate key="frontend.filter.tag" />
</label>
<f:form.select class="sgnews-select form-control" multiple="0" size="1" value="{selectedTag}"
<f:form.select class="sgnews-select form-control" multiple="0" size="1" value="{selectedTag.uid}"
property="tag" optionValueField="uid" options="{tags}" id="filter-tags"
optionLabelField="title" prependOptionLabel="" prependOptionValue=""/>
</f:form>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment