Skip to content

Commit 697d68f

Browse files
author
a.laurowski
authored
FFWEB-2124 hide category filter on category page
1 parent e11caec commit 697d68f

5 files changed

Lines changed: 16 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
- override `onKeyUp` to prevent sending redundant native suggest calls using `ajax_search` controller
1010
-`Resources/views/frontend/index/index.tpl`
1111
- restore adding `data-search` in `frontend_index_shop_navigation` block. Lack of this directive disabled the searchbox show/hide functionality in mobile
12-
12+
- Category Page
13+
- hide ff-asn-group for Category Path. User should use main navigation instead to correctly update the web components navigation mode state
14+
1315
## [v3.0.1] - 13.03.2022
1416
### Fix
1517
- fix `sid` attribute is defined in `ff-communication template` causing it to be generated always with same value

Resources/frontend/less/asn.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ ff-asn-group {
6767
.clusterLevel3 {
6868
.unitize(margin-left, 62);
6969
}
70+
&.hidden-group {
71+
display: none !important;
72+
}
7073
}
7174

7275
ff-slider {

Resources/views/frontend/factfinder/category.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
{block name='frontend_listing_actions_filter_form'}
2727
<div data-filter-form="true">
28-
{include file='frontend/factfinder/content/asn.tpl'}
28+
{include file='frontend/factfinder/content/asn.tpl' isNavigationPage=true categoryPathFieldName=$ffCategoryPathFieldName}
2929
{include file='frontend/factfinder/content/filter_cloud.tpl'}
3030
</div>
3131
{/block}

Resources/views/frontend/factfinder/content/asn.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
{block name='frontend_factfinder_asn'}
44
<ff-asn class="filter--facet-container" unresolved>
55
{block name='frontend_factfinder_asn_group'}
6+
{if $isNavigationPage}
7+
<ff-asn-group for-group="{$categoryPathFieldName}ROOT" style="display:none" class="hidden-group" disable-auto-expand>
8+
</ff-asn-group>
9+
{/if}
610
<ff-asn-group class="filter-panel filter--multi-selection" disable-auto-expand>
711
<div slot="groupCaption" class="filter-panel--title">
812
{'{{group.name}}'}

Subscriber/CategoryView.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ public function onPostDispatch(EventArgs $args): void
3939

4040
if ($id) {
4141
$view->extendsTemplate('frontend/factfinder/category.tpl');
42-
$view->assign('ffCategoryPath', $this->categoryPath->getValue($id));
42+
$categoryPath = $this->categoryPath->getValue($id);
43+
$view->assign('ffCategoryPath', $categoryPath);
44+
preg_replace_callback('/[^filter=]\w+(?=%3A)/', function (array $match) use ($view) {
45+
$view->assign('ffCategoryPathFieldName', $match[0]);
46+
}, $categoryPath);
4347
return;
4448
}
4549
}

0 commit comments

Comments
 (0)