-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdemo.html
74 lines (62 loc) · 1.68 KB
/
demo.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>MODx Revolution Ajax Filter</title>
</head>
<body>
<!-- Пример формы фильтра -->
<form class="ajax-form">
<!-- Sort Fields -->
<input type="hidden" name="sortby" value="pagetitle">
<input type="hidden" name="sortdir" value="asc">
<!-- Sort End -->
<label>
<input type="checkbox" name="garage"> Checkbox
</label>
<label>
<input name="floor" value="0" checked="" type="radio">
<input name="floor" value="1" type="radio">
<input name="floor" value="2" type="radio">
</label>
<label><input type="text" name="price"></label>
</form>
<!-- Пример создания кнопок сортировки -->
Сортировать по цене: <button data-sort-by="price">По возрастанию</button>
<!-- Вывод сниппета в шаблоне категории -->
<div class="ajax-container">
[[!catalogFilter?
&tpl=`tplCatItem`
&limit=`3`
&parents=`5`
&fields=`image,area,floor,garage,price`]]
</div>
<p>Пример чанка <strong>tplCatItem</strong></p>
<div class="ajax-item">
<img src="[[+tv.image]]" alt="[[+pagetitle]]">
<h4>[[+pagetitle]]</h4>
<table>
<tr>
<td>Этаж</td>
<td>[[+tv.floor]]</td>
</tr>
[[+tv.area:isnot=``:then=`
<tr>
<td>Площадь</td>
<td>[[+tv.area]] кв.м.</td>
</tr>
`]]
<tr>
<td>Гараж</td>
<td>[[+tv.garage:is=`1`:then=`Есть`:else=`Нет`]]</td>
</tr>
<tr>
<td>Цена:</td>
<td>[[+tv.price]]</td>
</tr>
</table>
</div>
<!-- Пример подключения скрипта -->
<script src="script.js"></script>
</body>
</html>