-
Notifications
You must be signed in to change notification settings - Fork 0
/
UniversalFilterPageInjections.txt
138 lines (138 loc) · 7.72 KB
/
UniversalFilterPageInjections.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<script>
window.customFilterSettings = {
'targets': [{
container: '#block-yui_3_17_2_3_1512982186827_4022',
items: '.summary-item'
},
{
container: '#block-yui_3_17_2_2_1514377351444_23783', //new summary id
items: '.summary-item',
settings: {
position: 'left', //may be 'top','left' or 'right'
align: 'left', //align filter and sort blocks, use 'left','center' or 'right'
showItemsCount: false, //hide items count
keepDropdownsOpen: true, //keep filter and sort dropdowns open
excludeFilter: 'Products', //top filter name, all items will be filtered including this filter values
simpleFilter: {
anim: true, //enables animation
show: {
effect: 'slideLeft', //available anims: 'fade','scale','slideLeft','slideTop','slideRight','slideBottom'
transitionDuration: 500, //anim duration
stagger: 60 //items anim delay
},
hide: {
effect: 'slideRight',
transitionDuration: 100,
stagger: 18
}
},
filter: {
enabled: true, //enabling filter (enabled by default)
category: false, //disabling default category dropdown
tag: false, //disabling default tag dropdown
items: [{
name: 'Products', //naming our new filter
options: [], //we may set predefined options here, but we do not want, let options build from existing
allowedOptions: ['Electronics', 'Clothing', 'Speakers'], // if this is defined, only these options will be added to dropdown if existing in items
initText: 'Filter Products', //this text visible until select some parameter
multiple: true, //allow several items be selected
defined: false, //set the first parameter active
children: ['!all|Type'], //!all - check Type filter dropdown if any Products value chosen (but not all)
checkChildren: true, //check if any children exist , and hide option if not
strict: true, //find items stict or like. if false and select Electronic, items with Electronics and Electonics Books will be showed
sort: 'asAllowed', //sort dropdown parameters exactly in the order you set in allowedOptions, by default it sorts in 'asc', you may also set 'desc' here
getAttr: 'categories' //get values from item categories
},
{
name: 'Type',
multiple: false,
strict: true,
getAttr: 'tags' //get values from items tags
}
]
},
sort: {
enabled: true,
items: [{
name: 'Price', //name of sort parameter, price is predefined and you do not need more params here
order: 'asc|desc' //add asc and desc order to parameters
}]
}
}
},
{
container: '#block-yui_3_17_2_2_1514457568711_34520', //new summary id
items: '.summary-item',
settings: {
isotope: {
enabled: true,
columnWidth: '30%', //if set, isotope will use this, you may use 'px' or '%', you may avoid this and configure your grid with css only
gutter: '20px', // you may avoid this and configure your grid with css only
transitionDuration: 400 //ms to animate, 300 used by default
},
simpleFilter: {
anim: false
},
position: 'left', //may be 'top','left' or 'right'
align: 'left', //align filter and sort blocks, use 'left','center' or 'right'
showItemsCount: false, //hide items count
keepDropdownsOpen: true, //keep filter and sort dropdowns open
excludeFilter: 'Products', //top filter name, all items will be filtered including this filter values
filter: {
enabled: true, //enabling filter (enabled by default)
category: false, //disabling default category dropdown
tag: false, //disabling default tag dropdown
items: [{
name: 'Products', //naming our new filter
options: [], //we may set predefined options here, but we do not want, let options build from existing
allowedOptions: ['Electronics', 'Clothing', 'Speakers'], // if this is defined, only these options will be added to dropdown if existing in items
initText: 'Filter Products', //this text visible until select some parameter
multiple: true, //allow several items be selected
defined: false, //set the first parameter active
children: ['!all|Type'], //!all - check Type filter dropdown if any Products value chosen (but not all)
checkChildren: true, //check if any children exist , and hide option if not
strict: true, //find items stict or like. if false and select Electronic, items with Electronics and Electonics Books will be showed
sort: 'asAllowed', //sort dropdown parameters exactly in the order you set in allowedOptions, by default it sorts in 'asc', you may also set 'desc' here
getAttr: 'categories' //get values from item categories
},
{
name: 'Type',
multiple: false,
strict: true,
getAttr: 'tags' //get values from items tags
}
]
},
sort: {
enabled: true,
items: [{
name: 'Price', //name of sort parameter, price is predefined and you do not need more params here
order: 'asc|desc', //add asc and desc order to parameters
sort: '[data-price] parseFloat' //select what attribute use to filter and parse to float
}]
}
}
},
{
container: '#block-yui_3_17_2_2_1514526630221_16771', //css selector to target container where you want to place filter
items: '.summary-item', //css selector for items you want to filter
settings: {
view: 'breadcrumbs',
simpleFilter: {
anim: true, //enables animation
show: {
effect: 'slideTop', //available anims: 'fade','scale','slideLeft','slideTop','slideRight','slideBottom'
transitionDuration: 500, //anim duration
stagger: 40 //items anim delay
},
hide: {
effect: 'slideRight',
transitionDuration: 300,
stagger: 18
}
}
}
}
]
};
</script>