Giter Club home page Giter Club logo

pdotools's People

Contributors

agelxnash avatar antixrist avatar bezumkin avatar bournwog avatar bruno17 avatar defoe avatar disjointed avatar enigmatic-user avatar faitno avatar gjpbw avatar grachov avatar gvozdb avatar ilyautkin avatar iwatchyoufromafar avatar jako avatar justbekami avatar kundius avatar maxfalcon avatar mekedron avatar rtripault avatar ruslan-aleev avatar sebastian-marinescu avatar sergant210 avatar setest avatar sintezcode avatar sottwell avatar tventos avatar vasia123 avatar vgrish avatar yujj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdotools's Issues

Добавление плейсхолдера количества потомков

Если здесь
https://github.com/bezumkin/pdoTools/blob/master/core/components/pdotools/model/pdotools/pdomenu.class.php

138-140 строки

else {
    $row['children'] = 0;
}

заменить на

if (!empty($row['children'])){
    $row['children'] = count($row['children']);
} else {
    $row['children'] = 0;
}

то мы в шаблоне меню сможем использовать плейсхолдер количества потомков у всех элементов, а не только у активного.
На мой взгляд, это будет удобно для решения многих практических задач.

Наборы параметров после деинсталляции пропали

Произвел деинсталляцию пакета.
Установил пакет.
В Инструменты -> Наборы параметров не отображаются.

Наборы параметров были созданы для pdoMenu, pdoResources. Наборы параметров не отображаются, но работаю и отображаются в настройках сниппета (вкладка параметры).

pdoPages - номер текущей страницы

Номер текущей страницы можно получить только во внутренних tpl, а во врапере к нему уже доступа нету. Есть задачи когда текущий номер нужен во врапере а не только в тпл активной страницы

Хотелось бы параметр titleField как в Breadcrumbs

Хотелось бы, чтобы pdoCrumbs имел параметр titleField , как Breadcrumbs.
В Breadcrumbs параметр titleField указывает откуда брать текст для построения Тайтла ссылки. По умолчанию это pagetitle.
При этом если указывается menutitle, но на странице он не заполнен, берется pagetitle.

Хлебные крошки это все же элемент навигации а pagetitle часто содержит много слов.

Console log output

I have a pdoResources call that gets triggered at OnSiteRefresh. It's logging this to the console:

SELECT SQL_CALC_FOUND_ROWS `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`content`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties` FROM `modx_site_content` AS `modResource` WHERE ( `modResource`.`published` = :0 AND `modResource`.`deleted` = :1 AND `modResource`.`context_key` = :2 ) ORDER BY modResource.publishedon DESC LIMIT 10 Array ( [/:0\b/] => 1 [/:1\b/] => 0 [/:2\b/] => 'stylesheet' )

Any idea where this is coming from, and how it can be stopped?

pdoSitemap urlencode

Добавьте плиз на 123 строчке:
$url=str_replace(array('%25','%2F','%3A'),array('%','/',':'),rawurlencode($url));
Для поддержки кириллистических дружественных урл.

pdoNeighbors и кавычки в tpl

Доброго времени суток, Василий.
Если попытаться указать, например, вот так:

<div class="neighbors">
  <div class="container">
    [[pdoNeighbors?
      &tplWrapper=`@INLINE <div class="row">[[+prev:default=`<div class="class">null</div>`]][[+next:default=`<div class="class">null</div>`]][[+up]]</div>`
      &tplPrev=`@INLINE <div class="class"><a href="[[+link]]">&larr; [[+menutitle]]</a></div>`
      &tplUp=`@INLINE <div class="class">&uarr; <a href="[[+link]]">[[+menutitle]]</a></div>`
      &tplNext=`@INLINE <div class="class"><a href="[[+link]]">[[+menutitle]] &rarr;</a></div>`]]
  </div>
</div>

, то &tplWrapper «смутится» и попытается вывести стандартный чанк. Как я понял, дело именно в двойных/одинарных кавычках при попытке указать класс для html-тега.

MODx permissions

In my tests, pdoMenu doesn't seem to obey the built-in MODx permissions. It lists pages that it shouldn't list.

date_ago от publishedon?

Добрый день, сейчас date_ago считается от createdon и в большинстве случаев это совпадает с publishedon, поэтому никаких проблем.

Но для блога, когда используется Tickets хорошо бы сделать доступным тег по publishedon, поскольку заметки часто вперед планируются и заводятся, а уже потом публикуются.
Ну и с товарами точно также, они могут долго висеть в системе прежде чем их опубликуют и они станут новинками для покупателей.
Было бы круто, если бы такое ТВ было доступно и от publishedon, а может и вообще можно заменить, вроде проблем не должно быть?

pdoMenu / 3 level collapsing menu

HI, I'm using Theme.bootstrap & pdoTools and I need 3 level collapsing menu.
example here: http://www.bootply.com/66089
My snippet call

<ul class="nav navbar-nav">
[[pdoMenu?
&startId=`0`
&level=`3`
&tplParentRow=`@INLINE
<li class="[[+classnames]] dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" [[+attributes]]>[[+menutitle]]<b class="caret"></b></a>
<ul class="dropdown-menu">[[+wrapper]]</ul>
</li>`
&tplOuter=`@INLINE [[+wrapper]]`
]]
</ul>

For some reason the third level is not showing?

Аналог renderResources

В официальном репозитории есть сниппет renderResources, который отображает выборку страниц использую указанный в настройках страницы шаблон. Весьма полезная вещь временами.

Использование Teleport

У меня нестабильное присутствие интернета, поэтому нередко сайт я делаю на локальном сервере, а потом переношу на внешний. Раньше я делал это с Vapor, однако разработчики MODX соорудили еще один инструмент, который гибче указанного Vapor — Teleport (https://github.com/modxcms/teleport).
Пакует-распаковывает — всё супер.Но есть пара моментов — это нефункционирование после инъекции сайта (в терминологии телепорта) пакетов Ace и pdoTools. И если первый лечится простым реинсталлом да и не влияет на фронтенд, то pdoTools заработал только после удаления, закачки заново, установки и "жесткой" очистки кэша. При этом, понятно, что во время всех этих операций во фронтеде не работали сниппеты, ипользующие pdoTools, и, как следствие, вместо страниц показывалось сообщение об ошибке.

get correct pdoFetch-class also in getObject and getCollection

Need to have the defined pdoFetch-class also within pdoField, which is calling pdoFetch->getObject.

Changed this lines:
https://github.com/bezumkin/pdoTools/blob/master/core/components/pdotools/model/pdotools/pdofetch.class.php#L833

and

https://github.com/bezumkin/pdoTools/blob/master/core/components/pdotools/model/pdotools/pdofetch.class.php#L901

to

        //$instance = new pdoFetch($this->modx, $config);

        $fqn = $this->modx->getOption('pdoFetch.class', null, 'pdotools.pdofetch', true);
        if ($pdoClass = $this->modx->loadClass($fqn, '', false, true)) {
            $instance = new $pdoClass($this->modx, $config);
        }
        else {
            @session_write_close();
            exit('Fatal error: could not load pdoTools!');
        }  

which seems to work.

Do you want me to make a pull-request, or is it ok to post my mod here like that?

tvFilters and includeTVList conflict

Using "pdoResources" & "pdoPage" with "includeTVList" and "tvFilters" parameters causes "includeTVList" to be ignored and the only TVs used are those in the tvFilters list.
Removing tvFilters from the snippet call fetches the correct tv list.

E.g:

This works and returns all the TVs in the includeTVList option.

[[!pdoPage?
        &elementClass=`modSnippet`
        &element=`pdoResources`
        &parents=`[[*id]]`
        &limit=`12`
        &showHidden=`1`
        &includeContent=`0`
        &includeTVs=`1`
        &processTVs=`1`
        &includeTVList=`tv1,tv2,tv3`
        &where=`{"template:IN":[id list]}`
        &tpl=`chunkname`
      ]]

But this does not, and returns only filter and filter2 but not tv1, tv2 and tv3

[[!pdoPage?
        &elementClass=`modSnippet`
        &element=`pdoResources`
        &parents=`[[*id]]`
        &limit=`12`
        &showHidden=`1`
        &includeContent=`0`
        &includeTVs=`1`
        &processTVs=`1`
        &includeTVList=`tv1,tv2,tv3`
        &where=`{"template:IN":[id list]}`
        &tpl=`chunkname`
        &tvFilters=`filter==value,filter2==value`
      ]]

Switching out pdoResources for getResources works fine.

pdoResource & depth & otherContext

Если нужно вывести документы из другого контекста, при используется параметр depth, то придется pdoResource завернуть в сниппет в котором перед вызовом сниппета сделать switchContext на нужный контекст, а потом опять вызвать эту же функцию чтобы вернуть все на место.
у modX::getChildIds есть 3 параметр в котором можно указывать контекст из которого производить поиск. Может быть стоит завести отдельный параметр типа depthContext?

Frequent errors in Error log.

I am using latest pdoTools 1.8.8pl2 and I am seeing constant stream of errors like below in MODX Error Log.

[2013-11-13 01:30:52] (ERROR @ /home/USER/public_html/core/components/pdotools/model/pdotools/pdofetch.class.php : 823) Recoverable error: Argument 1 passed to pdoFetch::replaceTVCondition() must be an array, null given, called in /home/USER/public_html/core/components/pdotools/model/pdotools/pdofetch.class.php on line 187 and defined
[2013-11-13 01:30:52] (ERROR @ /home/USER/public_html/core/components/pdotools/model/pdotools/pdofetch.class.php : 830) PHP warning: Invalid argument supplied for foreach()

I am using PHP Version 5.3.22.

Kindly advise.

tvFilters и значения по умолчанию

Когда значение ТВ равно его значению по-умолчанию - оно не записывается в БД и фильтрация работает некорректно.

Нужно добавить проверку на такой случай.

Parser Improvement

I've found myself in situations wanting to know the value of the field of a MODX Object without having to invoke a simple query Snippet. For instance: Sometimes I'd like to get the templatename of a Template by its ID. Right now, I'm solving this with Custom Output Modifiers, but it might be fairly easy to do so with the pdoParser.

Line 52 of pdomenu.class.php broken?

if ($pdoClass = $modx->loadClass($fqn, '', false, true))

This will never evaluate to true, since the second parameter is empty, and $modx has no idea where to get the include file.

The above line only works when I do this:

if ($pdoClass = $modx->loadClass($fqn, MODX_CORE_PATH . 'components/pdotools/model/', false, true))

pdoResources &sortby with FIELD() not working?

Hi Vasily,

first, thanks for all the work on pdoTools in the past months, this is one of the most valuable extras for modx, really appreciate it!

I'm playing around with optimizing a slow site of mine with pdoResources (as getResources seems to be the main bottleneck) but I have some problems with sorting the resources as I did with getResources where you can specify something like

&sortby=`FIELD(modResource.id,392,230,538,476,210,530,110,209,118,84,228,229)`

which sorts the resources in that exact order that is specified, when I try that with pdoResources it doesn't seem to work. I try something like that:

[[!pdoResources?
    &parents=`-1`
    &tpl=`article.teaser`
    &where=`{"published":"1", "id:IN":"392,230,538,476,210,530,110,209,118,84,228,229"}`
    &select=``
    &includeTVs=`article.teaser.claim,article.teaser.title,article.teaser.link,article.teaser.img,article.img.full,team-img,team-job`
    &sortby=`FIELD(modResource.id,392,230,538,476,210,530,110,209,118,84,228,229)`
    &sortdir=`ASC`
    &showLog=`1`
]]

sorry for that long thing, this is the output of pdoTools log for the above pdoResources call:

0.0002990: PDOTOOLS LOADED
0.0001180: XPDO QUERY OBJECT CREATED
0.0028951: INCLUDED LIST OF TVS: ARTICLE.IMG.FULL, ARTICLE.TEASER.CLAIM, ARTICLE.TEASER.IMG, ARTICLE.TEASER.LINK, ARTICLE.TEASER.TITLE, TEAM-IMG, TEAM-JOB
0.0009658: LEFTJOINED MODTEMPLATEVARRESOURCE AS TVARTICLE.IMG.FULL
0.0008290: LEFTJOINED MODTEMPLATEVARRESOURCE AS TVARTICLE.TEASER.CLAIM
0.0008190: LEFTJOINED MODTEMPLATEVARRESOURCE AS TVARTICLE.TEASER.IMG
0.0008230: LEFTJOINED MODTEMPLATEVARRESOURCE AS TVARTICLE.TEASER.LINK
0.0008371: LEFTJOINED MODTEMPLATEVARRESOURCE AS TVARTICLE.TEASER.TITLE
0.0007920: LEFTJOINED MODTEMPLATEVARRESOURCE AS TVTEAM-IMG
0.0008500: LEFTJOINED MODTEMPLATEVARRESOURCE AS TVTEAM-JOB
0.0013378: ADDED SELECTION OF MODRESOURCE: SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
0.0000441: ADDED SELECTION OF TVARTICLE.IMG.FULL: IFNULL(`value`, '') AS `tv.article.img.full`
0.0000331: ADDED SELECTION OF TVARTICLE.TEASER.CLAIM: IFNULL(`value`, '') AS `tv.article.teaser.claim`
0.0000350: ADDED SELECTION OF TVARTICLE.TEASER.IMG: IFNULL(`value`, '') AS `tv.article.teaser.img`
0.0000329: ADDED SELECTION OF TVARTICLE.TEASER.LINK: IFNULL(`value`, '') AS `tv.article.teaser.link`
0.0000339: ADDED SELECTION OF TVARTICLE.TEASER.TITLE: IFNULL(`value`, '') AS `tv.article.teaser.title`
0.0000329: ADDED SELECTION OF TVTEAM-IMG: IFNULL(`value`, '') AS `tv.team-img`
0.0000322: ADDED SELECTION OF TVTEAM-JOB: IFNULL(`value`, '') AS `tv.team-job`
0.0002360: REPLACED TV CONDITIONS
0.0115809: PROCESSED ADDITIONAL CONDITIONS
0.0138662: ADDED WHERE CONDITION: PUBLISHED=1, ID:IN=267,103,82,211,102, MODRESOURCE.PARENT:IN(1,2,3,4,5,6,60,61,63,150,7,8,62,202,9,50,197,278,268,21,15,221,107,109,110,491,111,118,238,378,379,246,313,301,330,306,147,276,263,16,19,323,314,376,338,367,382,383,411,412,452,476,478,480,500,521,527,530,512,511,225,409,226,274,417,418,472,420,523,222,193,231,380,381,230,84,76,88,89,188,299,300,356,275,77,309,328,335,339,353,361,369,375,391,398,433,444,454,459,463,466,473,479,484,492,498,501,504,514,522,526,529,535,538,81,82,83,228,229,372,374,394,464,475,490,506,508,510,516,517,518,520,525,528,532,534,86,85,90,91,92,298,360,392,93,94,95,253,334,102,482,533,96,211,213,232,98,207,310,214,208,210,216,264,227,320,97,251,209,99,195,212,311,322,351,377,384,393,371,408,410,108,112,113,114,115,117,116,119,137,242,243,140,138,161,245,244,162,163,145,164,184,167,180,181,185,239,165,171,166,397,168,159,170,169,255,182,183,471,241,160,172,173,141,179,187,174,470,531,240,178,176,341,177,175,146,474,120,121,70,64,65,66,67,68,387,69,128,477,71,72,73,74,75,78,233,234,388,342,343,337,349,358,217,218,350,354,359,370,401,404,427,434,435,436,438,458,460,483,507,344,345,357,143,467,305,303,302,139,136,254,317,336,346,347,348,355,363,368,385,386,390,399,400,407,413,414,421,422,423,424,425,426,428,429,430,431,432,439,442,443,445,446,447,448,449,450,451,456,457,461,462,465,487,488,489,493,494,495,499,502,503,515,151,154,153,155,362,373,395,402,403,405,437,453,455,481,485,486,497,509,524,537,539,100,248,250,249,13,52,104,235,123,189,190,122,191,105,396,419,124,125,126,127,219,203,265,204,307,205,206,236,237,256,312,79,352,10,59,129,186,49,192,53,152,266,130,416,131,132,148,156,259,261,194,196,220,326,327,51,54,144,133,157,158,18,415,257,134,135,198,199,200,201,279,289,280,281,282,283,284,285,286,287,288,290,291,292,293,294,269,223,267,270,271,101,272,103,34,35,22,25,364,26,29,32,55,37,27,36,28,48,42,45,46,39,47,38,40,41,496,43,44,30,33,24,149,340,321,365,31), MODRESOURCE.PARENT:NOT IN(1,15,221,107,109,110,491,111,118,238,378,379,246,313,301,330,306,147,276,263,16,19,323,314,376,338,367,382,383,411,412,452,476,478,480,500,521,527,530,512,511,225,409,226,274,417,418,472,420,523,222), MODRESOURCE.DELETED=0
0.0000920: REPLACED TV CONDITIONS
0.0001521: SORTED BY FIELD(MODRESOURCE.ID,267,103,82,211,102), ASC
0.0000141: LIMITED TO 10, OFFSET 0
0.0013359: SQL PREPARED "SELECT SQL_CALC_FOUND_ROWS `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties`, IFNULL(`TVarticle.img.full`.`value`, '') AS `tv.article.img.full`, IFNULL(`TVarticle.teaser.claim`.`value`, '') AS `tv.article.teaser.claim`, IFNULL(`TVarticle.teaser.img`.`value`, '') AS `tv.article.teaser.img`, IFNULL(`TVarticle.teaser.link`.`value`, '') AS `tv.article.teaser.link`, IFNULL(`TVarticle.teaser.title`.`value`, '') AS `tv.article.teaser.title`, IFNULL(`TVteam-img`.`value`, '') AS `tv.team-img`, IFNULL(`TVteam-job`.`value`, '') AS `tv.team-job` FROM `modx_site_content` AS `modResource` LEFT JOIN `modx_site_tmplvar_contentvalues` `TVarticle.img.full` ON `TVarticle.img.full`.`contentid` = `modResource`.`id` AND `TVarticle.img.full`.`tmplvarid` = 17 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVarticle.teaser.claim` ON `TVarticle.teaser.claim`.`contentid` = `modResource`.`id` AND `TVarticle.teaser.claim`.`tmplvarid` = 20 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVarticle.teaser.img` ON `TVarticle.teaser.img`.`contentid` = `modResource`.`id` AND `TVarticle.teaser.img`.`tmplvarid` = 9 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVarticle.teaser.link` ON `TVarticle.teaser.link`.`contentid` = `modResource`.`id` AND `TVarticle.teaser.link`.`tmplvarid` = 65 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVarticle.teaser.title` ON `TVarticle.teaser.title`.`contentid` = `modResource`.`id` AND `TVarticle.teaser.title`.`tmplvarid` = 19 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVteam-img` ON `TVteam-img`.`contentid` = `modResource`.`id` AND `TVteam-img`.`tmplvarid` = 37 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVteam-job` ON `TVteam-job`.`contentid` = `modResource`.`id` AND `TVteam-job`.`tmplvarid` = 35 WHERE  ( `modResource`.`published` = 1 AND `modResource`.`id` IN 267 AND `modResource`.`parent` IN (1,2,3,4,5,6,60,61,63,150,7,8,62,202,9,50,197,278,268,21,15,221,107,109,110,491,111,118,238,378,379,246,313,301,330,306,147,276,263,16,19,323,314,376,338,367,382,383,411,412,452,476,478,480,500,521,527,530,512,511,225,409,226,274,417,418,472,420,523,222,193,231,380,381,230,84,76,88,89,188,299,300,356,275,77,309,328,335,339,353,361,369,375,391,398,433,444,454,459,463,466,473,479,484,492,498,501,504,514,522,526,529,535,538,81,82,83,228,229,372,374,394,464,475,490,506,508,510,516,517,518,520,525,528,532,534,86,85,90,91,92,298,360,392,93,94,95,253,334,102,482,533,96,211,213,232,98,207,310,214,208,210,216,264,227,320,97,251,209,99,195,212,311,322,351,377,384,393,371,408,410,108,112,113,114,115,117,116,119,137,242,243,140,138,161,245,244,162,163,145,164,184,167,180,181,185,239,165,171,166,397,168,159,170,169,255,182,183,471,241,160,172,173,141,179,187,174,470,531,240,178,176,341,177,175,146,474,120,121,70,64,65,66,67,68,387,69,128,477,71,72,73,74,75,78,233,234,388,342,343,337,349,358,217,218,350,354,359,370,401,404,427,434,435,436,438,458,460,483,507,344,345,357,143,467,305,303,302,139,136,254,317,336,346,347,348,355,363,368,385,386,390,399,400,407,413,414,421,422,423,424,425,426,428,429,430,431,432,439,442,443,445,446,447,448,449,450,451,456,457,461,462,465,487,488,489,493,494,495,499,502,503,515,151,154,153,155,362,373,395,402,403,405,437,453,455,481,485,486,497,509,524,537,539,100,248,250,249,13,52,104,235,123,189,190,122,191,105,396,419,124,125,126,127,219,203,265,204,307,205,206,236,237,256,312,79,352,10,59,129,186,49,192,53,152,266,130,416,131,132,148,156,259,261,194,196,220,326,327,51,54,144,133,157,158,18,415,257,134,135,198,199,200,201,279,289,280,281,282,283,284,285,286,287,288,290,291,292,293,294,269,223,267,270,271,101,272,103,34,35,22,25,364,26,29,32,55,37,27,36,28,48,42,45,46,39,47,38,40,41,496,43,44,30,33,24,149,340,321,365,31) AND `modResource`.`parent` NOT IN (1,15,221,107,109,110,491,111,118,238,378,379,246,313,301,330,306,147,276,263,16,19,323,314,376,338,367,382,383,411,412,452,476,478,480,500,521,527,530,512,511,225,409,226,274,417,418,472,420,523,222) AND `modResource`.`deleted` = 0 )  ORDER BY FIELD(modResource.id,267,103,82,211,102) ASC LIMIT 10 "
0.0016551: COULD NOT PROCESS QUERY, ERROR #1064: YOU HAVE AN ERROR IN YOUR SQL SYNTAX; CHECK THE MANUAL THAT CORRESPONDS TO YOUR MYSQL SERVER VERSION FOR THE RIGHT SYNTAX TO USE NEAR ''267,103,82,211,102' AND `MODRESOURCE`.`PARENT` IN (1,2,3,4,5,6,60,61,63,150,7,8' AT LINE 1
0.0285130: TOTAL TIME
18 612 224: MEMORY USAGE

any idea whats wrong there?

К сведению.

Не понимает плейсхолдер [[+wf.menutitle]]
[[+menutitle]] работает

not caching uncachable tags

using something like that snippet - call:

[[!pdoPage? 
    &parents=`0` 
    &resources=`[[*id]]` 
    &tpl=`multilang_resourceTemplate` 
    &includeTVs=`mml_pagetitle,mml_longtitle,mml_introtext,mml_content,colors` 
    &prepareTVs=`1` 
    &processTVs=`1`
        &tvPrefix=`` 
    &loadModels=`migxmultilang`
        &prepareSnippet = `mmlTranslatePdoToolsRow`
        &cache = `1`
]]

seems to process and cache uncachable snippets in it.

is there a way not to cache uncachable snippets and other uncachable tags?

Вывод детей скрытых и не опубликованных родителей

При настройках по-умолчанию меню не строится, если опубликованные или доступные для меню ресурсы содержатся в parent, который скрыт для меню или не опубликован.

Обходится включением showHidden и showUnpublished, но тогда все скрытые и неопубликованные элементы внутри родителя тоже выводятся в меню.
Можно обойти принудительным исключением этих ресурсов посредством "-", но это убивает автоматизацию.

Думаю, что правильнее чтобы в таком случае, дочерние элементы выводились вне зависимости от статуса парента, а вот статус самого парента влиял на displayStart.

Модификаторы для pdoTools

В pdoMenu (в остальных еще не успел посмотреть) не работают модификаторы, например если проверять на пустоту вывода результата
[[!pdoMenu:empty='пусто']]
то хоть запрос и пустой, но все же он выводит вот такую часть
<ul class=""/>
, ну вот и получается, что данных нет, но строка все же не пустая!!!

Плейсхолдер ссылки при назначении в @INLINE

При вот таком назначении ссылки

&tpl=`@INLINE<li><a href="[[~[[+id]]]]">[[+pagetitle]]</a></li>`

в DOM ничего не выводится.
Если то же самое назначать через чанк:

&tpl=`someChunk`

в someChunk пишем:

<li><a href="[[~[[+id]]]]">[[+pagetitle]]</a></li>

, то всё работает корректно.

pdoMenu tplCategoryFolders

Пожалуйста исправьте в сниппете pdoMenu параметр tplCategoryFolder на tplCategoryFolders
А также, в сниппете pdoMenu на 91 строчке
'categoryFoldersTpl' => 'tplCategoryFolders',
и тут core/components/pdotools/model/pdotools/pdomenu.class.php на 262 строке
elseif (($row['children'] || $row['isfolder']) && (empty($row['template']) || strpos($row['link_attributes'], 'category') !== false) && !empty($this->pdoTools->config['tplCategoryFolders'])) {
$tpl = 'tplCategoryFolders';
}

Иначе не работает чанк tplCategoryFolders

pdoMenu: вывод tplOuter при пустом wrapper'e

при пустой выдаче выводит содержимое tplOuter, т.е.

[[pdoMenu?
&tplOuter=@INLINE <ul>[[+wrapper]]</ul>
&toPlaceholder=mainnav ]]

надо делать с:
[[+mainnav:isnot=<ul></ul>:then=<div>[[+mainnav]]</div>]],

а не:
[[+mainnav:notempty=<div>[[+mainnav]]</div>]]

pdotools 191beta

Simlink в pdoMenu

Не работает обработка символических ссылок в pdoMenu

pdoResources returnIds и toPlaceholder

Можно сделать, чтобы идентификаторы тоже записывались в плейсхолдер, а не возвращались сразу? Бывает нужно =)

[Q] About &tpl_N and &tpl_nN

I have converted from getResources to pdoResources, but I am having a difficulty attaining the functionality of the following:

With getResources, when I use &tpl_2=siteList.ad`` I get the 2nd result replaced to chunk name siteList.ad on every page. eg. If the 2nd result is showing ad on homepage and I navigate to ?page=2, the page2 also show 2nd result with ad.

But with pdoResources, 2nd result on homepage gets changed, and all other pages eg. ?page2, ?page3 etc have no ad.

I have also tried with &tpl_n2, but that replaces every 3rd result with ad which is not what I want to do.

Can you advise on this issue.

Thanks.

pdoMenu tplCategoryFolders

Пожалуйста исправьте в сниппете pdoMenu параметр tplCategoryFolder на tplCategoryFolders
А также, в сниппете pdoMenu на 91 строчке
'categoryFoldersTpl' => 'tplCategoryFolders',
и тут core/components/pdotools/model/pdotools/pdomenu.class.php на 262 строке
elseif (($row['children'] || $row['isfolder']) && (empty($row['template']) || strpos($row['link_attributes'], 'category') !== false) && !empty($this->pdoTools->config['tplCategoryFolders'])) {
$tpl = 'tplCategoryFolders';
}

Не учитываются источники файлов при вызове TV

Значения файловых TV, вне зависимости от выбранного источника файлов, выводятся относительно корня.

К примеру, есть у нас источник Uploads, смотрящий в http://sitename/uploads/, если мы зальем туда картинку, укажем ее в TV и попробуем вызвать это TV внутри шаблона pdoResources, то путь к картинке будет выведен как http://sitename/image.jpg а не http://sitename/uploads/image.jpg.

MODX Revolution 2.2.10-pl (advanced)
pdoTools 1.8.0-rc5

Пустые TV изображения и источники файлов

Если ТВ с изображением не задано для ресурса, то обычный вывод в шаблоне [[*image]] вернет пустую строку какой источник файлов бы ни был задан. Но в pdoTools возвращает путь к источнику. Это ломает проверку на пустоту при выводе [[+image:notempty=<бла><бла><бла><img src="[[+image]]"><бла><бла><бла>]]

Вот здесь иллюстрация разного поведения: http://s4382.modx-test.com
Логин s4382
Пароль CQjaYGCkwR6z

в шаблоне:

<p>Resource TV image: [[*image]]</p>
<p>pdoResources chunk-TV image: [[pdoResources? &tpl=`@INLINE [[+image]]` &parents=`0` &includeTVs=`image` &tvPrefix=``]]</p>

<p>Resource empty TV image: [[*empty_image]]</p>
<p>pdoResources empty chunk-TV image: [[pdoResources? &tpl=`@INLINE [[+empty_image]]` &parents=`0` &includeTVs=`empty_image` &tvPrefix=``]]</p>

И еще часто раздражающий момент. При перетаскивании сниппетов в поле шаблона, когда выводится список параметров, указываешь там пустой tvPrefix, а в итоге получается &tvPrefix=0 и соответственно твшки не выводятся (постоянно забываю убрать 0 :)). Если это бага самого MODX, то может быть в компоненте приравнять 0 к пустой строке. Сомневаюсь, что кому-то нужны префиксы с нулем :).

using custom extented classes

Hi bezumkin.

First Time, using pdoTools.
Really big work! Thanks for creating this package!

Have created a new class (mmlFetch), which does extend pdoFetch with a custom addTVs - function to get additional translated TV-content for a multiLang - solution (migxMultiLang) I'm working on.

Is there a way to say to all pdoTools, to use this class instead of pdoFetch directly without hacking all snippets and Classes or do you see a way how to add this feature, may be with a system-setting or a snippet-property, where we can set the pdoFetch - class (mmlFetch in my Case)?

Allow properties of 1 and 0 in pdoMenu snippet

if($scriptProperties['checkPermissions'] == '0') {$scriptProperties['checkPermissions'] = '';}
if($scriptProperties['checkPermissions'] == '1') {$scriptProperties['checkPermissions'] = 'load,list,view';}

custom sort option

As I'm working with pdoMenu, I'm noticing that the &resources parameter seems to sort by ID, even if I put the ids in a different order. Here's my call:

[[pdoMenu? &parents=0 &resources=99,748,443,1086 &ignoreHidden=1 &permissions=list]]

The output order is 99,443,748,1086. Is there a way that I can preserve the original order (99,748,443,1086)?

Usage / rebuild getResources

Hi,

I really want to try if I can somehow rebuild getResources (at least in part) with pdoTools and make it much faster in the process...but I couldn't get it right yet because I'm not getting enough out of the examples/documentation/code from tickets etc., so I wanted to ask if you maybe could give some additional hints of how to do it...what I tried for now was just fetching some simple resources fields of standard modResource objects like this

<?php
$pdoFetch = $modx->getService('pdofetch','pdoFetch', MODX_CORE_PATH.'components/pdotools/model/pdotools/');

if ( $pdoFetch instanceof pdoFetch ) {

    //echo '<pre>' . print_r($pdoFetch->config,1) . '</pre>';
    $rows = $pdoFetch->run();

    if (!empty($rows) && is_array($rows)) {
        echo 'rows is array'; // I never get this...var dump gives a biiiig string
        foreach ($rows as $row) {
            //echo $row['pagetitle'];
            //var_dump($row);
        }
    }
//var_dump($rows);
}
//var_dump($rows);
}

but I cannot even get the pagetitle out of this, already stuck after running pdoFetch, seems to just give me back one big string (with the right information inside, by the way) that I cannot process further. So I guess I'm missing something, probably some config stuff, but I don't get yet how to set it...would be very nice of you if you can give some hints to get me started =)

Добавить параметр использующий для tpl шаблон документа

  1. В репозитории Modx помимо getResources есть сниппет renderResources

  2. Что делает:

— всё то же самое, за одним исключением — шаблон для вывода документов задается НЕ через сниппет, а используется параметр «шаблон» самого документа.

  1. Зачем нужно:

— например можно очень легко и удобно ДЛЯ НЕОПЫТНОГО КОНТЕНТ МЕНЕДЖЕРА организовать вывод на главную страницу разнообразных по размеру и стилевому оформлению виджетов (используя дочерние страницы), по заранее подготовленным шаблонам. Клиент легко сможет менять порядок вывода виджетов через дерево документов, а стиль через параметр Шаблон каждого дочернего документа.

Может быть нетрудно добавить в параметры pdoResources что-нибудь типа: &useDocTpl=1 ???

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.