Skip to content

Instantly share code, notes, and snippets.

View Ditto.php
[[Ditto? &tpl=`category_tpl` &parents=`[*id*]` &display=`all` &orderBy=`menuindex ASC`]]
фильтрация по TV чекбоксу
[!Ditto? &tpl=`brand_item` &tplLast=`brand_item_last` &where=`@SQL: AND (tvc.tmplvarid = '26' AND tvc.value = 'Да')` &parents=`17` &display=`all` &noResults=`Таких брендов нет` &orderBy=`menuindex ASC`!]
[!Ditto? &tpl=`item_catalog_TPL` &documents=`[!filter? &pageId=`[*id*]` &mode=`2`!]` &noResults=`По заданным параметрам ничего не найдено!` &display=`all` &orderBy=`menuindex ASC`!]
[+ditto_class+] С версии 2.1.1. Выводит классы even/odd, first/last и current
[+ditto_iteration+] Порядковый номер полученного документа в пределах текущей страницы
@morozVA
morozVA / doclister.php
Last active Feb 23, 2018
evo DocLister
View doclister.php
[[DocLister?
&display=`20`
&orderBy=`availability ASC, price ASC`
&parents=`7`
&tvList=`new,sale,discount,quantity,code,image,price,old-price`
&renderTV=`image`
&tpl=`search_result`
&tplLast=`@CODE `
&id=`search`
&addWhereList=`c.template IN (9)`
@morozVA
morozVA / DLcrumbs.php
Last active Jan 3, 2018
evo DLcrumbs
View DLcrumbs.php
[[DLcrumbs?
&ownerTPL=`@CODE:<ul class="inline bcrumb">[+crumbs.wrap+]</ul>`
&tpl=`@CODE:<li><a href="[+url+]">[+e.title+]</a></li>`
&tplCurrent=`@CODE:<li class="active">[+e.title+]</li>`
&showCurrent=`1`
]]
@morozVA
morozVA / DLBuildMenu.php
Last active Mar 16, 2018
evo DLBuildMenu
View DLBuildMenu.php
[[DLBuildMenu?
&parents=`5`
&maxDepth=`2`
&activeClass=`active`
&addWhereList=`c.template = 7`
&orderBy=`menuindex ASC`
&TplMainOwner=`@CODE: <ul id="accordion" role="tablist" aria-multiselectable="false" class="panel-group">[+dl.wrap+]</ul>`
&TplSubOwner=`@CODE:<ul class="sub-menu panel-collapse collapse" id="[+iteration+]">[+dl.wrap+]</ul>`
&TplOneItem=`@CODE: <li class="panel [+dl.class+]"><div role="tab"><a class="plus-link" data-toggle="collapse" data-parent="#accordion" href="#[+iteration+]"><i class="fa fa-caret-down" aria-hidden="true"></i><i class="fa fa-caret-up" aria-hidden="true"></i></a><a href="[+url+]" title="[+e.title+]">[+title+]</a></div>[+dl.submenu+]</li>`
&TplDepth2=`@CODE:<li class="[+dl.class+]"><a href="[+url+]" title="[+e.title+]">[+title+]</a></li>`
@morozVA
morozVA / DocLister search.php
Last active Apr 30, 2019
evo DocLister search
View DocLister search.php
<form class="head-search" id="NavSearchForm" action="[~46~]" method="post">
<input id="search-input" placeholder="Поиск по каталогу..." class="form-control cleardefault search_place validation_place" type="text" name="search" value="" />
<button class="btn btn-primary not_valid" type="submit">Найти</button>
</form>
<div class="row search-result">
[[DocLister?
&display=`20`
&orderBy=`availability ASC, price ASC`
&parents=`7`
View ajaxSearch.php
Вызов формы
[!AjaxSearch? &ajaxSearch=`0` &landingPage=`22` &tplInput=`search_form` &parents=`in:5` &tplResult=`search_result` &showResults=`0`!]
Страница поиска
<ul class="search_list">[!AjaxSearch? &ajaxSearch=`0` &parents=`in:5` &pagingType=`0` &showInputForm=`0` &tplResult=`search_result` &extractLength=`500` &grabMax=`10` &showInputForm=`0` !]</ul>
чанк search_form
<div class="navSearch">
View eform.php
<div class="modal fade" id="callBack">
<div class="modal-dialog modal-sm">
<div id="myModal_form">
[!eForm? &formid=`Form` &fromname=`admin@site.by` &from=`admin@site.by` &to=`[[DocInfo? &docid=`2` &field=`send-email`]]` &tpl=`tplForm` &report=`tplReport` &thankyou=`tplThank` &subject=`Заказ звонка с сайта [(site_name)]`!]
</div>
</div>
</div>
tplForm
<form method="post" action="[~[*id*]~]" name="Form" id="Form" class="modal-content">
View watermarked.php
<?php
header('content-type: image/jpeg');
// Should be a safe image repository if you
// need to make sense.
$dirprefix = "http://sitename.com/";
$watermark = $dirprefix."/assets/images/watermark.png";
$image = $dirprefix.$_REQUEST['src'];
View wayfinder.php
[[Wayfinder? &startId=`[*parent*]` &excludeDocs=`6,7` &includeDocs=`5,6` &level=`3` &outerTpl=`outerTpl` &rowTpl=`rowTpl` &innerTpl=`innerTpl` &innerRowTpl=`innerRowTpl` &hereClass=`hereClass` &ignoreHidden=`1` ]]
outerTpl
<ul[+wf.classes+]>[+wf.wrapper+]</ul>
rowTpl
<li[+wf.id+][+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>[+wf.wrapper+]</li>
View webloginPe.php
В методе function Register в классе webloginPe просто
1. Напишите вместо строки
<code>$username = $_POST['username'];</code>
строку
<code>$username = $modx->db->escape($modx->stripTags($_POST['email']));</code>
2. Закомментируйте кусок кода чуть ниже (валидация username)
<code>if (!ctype_alnum($username))
{
return $this->FormatMessage($this->LanguageArray[32]);
}</code>