getResources and getPage - MODX Community Forums https://forums.modx.com/board/?board=74 <![CDATA[excluding list of resources from getResources call as fetched from TV]]> https://forums.modx.com/thread/104630/excluding-list-of-resources-from-getresources-call-as-fetched-from-tv#dis-post-562793
So fetchedLIST TV will output: 1,12,34,78 for example - these being the IDs of the resources to ignore in the getResources call

So, in effect a way of having resources=`-[[*fetchedLIST]]` but needing to add a - before EACH of the IDs returned by TV fetchedLIST

So if I had resources in the parent resource 12 with ids: 1,2,3,4,12,34 and 78

I would want my getResources call to just display those from the group above, that ARE NOT included in the fetchedLIST TV - so not 1,12,34 and 78 - so the output of the getresources call would be the data for JUST resources ID: 2,3 and 4


]]>
https://forums.modx.com/thread/104630/excluding-list-of-resources-from-getresources-call-as-fetched-from-tv#dis-post-562793 Fri, 16 Nov 2018 11:08:11 +0000 https://forums.modx.com/thread/104630/excluding-list-of-resources-from-getresources-call-as-fetched-from-tv#dis-post-562793
<![CDATA[Archivist Landing Page Blank]]> https://forums.modx.com/thread/103611/archivist-landing-page-blank#dis-post-562478 Archivist 1.2.4
pdoTools 2.11.0

Archivist is correctly generating the year/month links and the number of articles for a given month. And clicking on a month redirects to the correct landing page (archive.html). All of that works as expected.

The problem is if I click, for example, on the July 2016 link the landing page url shows as, https://mysite/archive.html2016/07 and is completely blank.

Things were working correctly for a couple years and now they aren't. I haven't changed anything having to do with Archivist so I'm not sure what happened.]]>
https://forums.modx.com/thread/103611/archivist-landing-page-blank#dis-post-562478 Thu, 01 Nov 2018 08:18:03 +0000 https://forums.modx.com/thread/103611/archivist-landing-page-blank#dis-post-562478
<![CDATA[pdoResources and tvFilters]]> https://forums.modx.com/thread/92071/pdoresources-and-tvfilters?page=2#dis-post-559282
[[!pdoResources? 
    &parents=`1`
    &limit=`1`
    &tpl=`popularTripsTpl` 
    &tvFilters=`featured==1`
    &includeTVs=`tripthumb,mml_pagetitle,mml_introtext,featured,count-trips` 
    &prepareTVs=`1`
    &loadModels=`migxmultilang`
    &prepareSnippet = `mmlTranslatePdoToolsRow`
    &showLog=`1`
]]


A very similar listing using a TV to orderby works fine:
[[!pdoResources? 
    &parents=`1`
    &limit=`3`
    &tpl=`popularTripsTpl` 
    &sortby=`count-trips`
    &sortdir=`DESC`
    &includeTVs=`tripthumb,mml_pagetitle,mml_introtext,count-trips` 
    &prepareTVs=`1`
    &loadModels=`migxmultilang`
    &prepareSnippet = `mmlTranslatePdoToolsRow`
]]


The log output:
0.0002019: pdoTools loaded
0.0000432: Loaded model "migxmultilang" from "/core/components/migxmultilang/model/"
0.0000498: xPDO query object created
0.0000701: Added TVs filters
0.0007250: Included list of tvs: mml_pagetitle, mml_introtext, tripthumb, count-trips, featured
0.0005169: leftJoined modTemplateVarResource as TVmml_pagetitle
0.0005069: leftJoined modTemplateVarResource as TVmml_introtext
0.0004590: leftJoined modTemplateVarResource as TVtripthumb
0.0005240: leftJoined modTemplateVarResource as TVcount-trips
0.0004590: leftJoined modTemplateVarResource as TVfeatured
0.0007908: 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.0000191: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.mml_pagetitle`
0.0000150: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.mml_introtext`
0.0000141: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.tripthumb`
0.0000150: Added selection of modTemplateVarResource: IFNULL(`value`, '0') AS `tv.count-trips`
0.0000150: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `tv.featured`
0.0000808: Replaced TV conditions
0.0008380: Processed additional conditions
0.0015631: Added where condition: 0=`TVfeatured`.`value` LIKE '1', modResource.parent:IN(1,18,19,20,21,22,23,24,25), modResource.published=1, modResource.deleted=0
0.0000470: Replaced TV conditions
0.0002229: Sorted by modResource.publishedon, DESC
0.0000081: Limited to 1, offset 0
0.0004170: 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(`TVmml_pagetitle`.`value`, '') AS `tv.mml_pagetitle`, IFNULL(`TVmml_introtext`.`value`, '') AS `tv.mml_introtext`, IFNULL(`TVtripthumb`.`value`, '') AS `tv.tripthumb`, IFNULL(`TVcount-trips`.`value`, '0') AS `tv.count-trips`, IFNULL(`TVfeatured`.`value`, '') AS `tv.featured` FROM `modx_site_content` AS `modResource` LEFT JOIN `modx_site_tmplvar_contentvalues` `TVmml_pagetitle` ON `TVmml_pagetitle`.`contentid` = `modResource`.`id` AND `TVmml_pagetitle`.`tmplvarid` = 1 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVmml_introtext` ON `TVmml_introtext`.`contentid` = `modResource`.`id` AND `TVmml_introtext`.`tmplvarid` = 4 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVtripthumb` ON `TVtripthumb`.`contentid` = `modResource`.`id` AND `TVtripthumb`.`tmplvarid` = 8 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVcount-trips` ON `TVcount-trips`.`contentid` = `modResource`.`id` AND `TVcount-trips`.`tmplvarid` = 9 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVfeatured` ON `TVfeatured`.`contentid` = `modResource`.`id` AND `TVfeatured`.`tmplvarid` = 10 WHERE  ( `TVfeatured`.`value` LIKE '1' AND `modResource`.`parent` IN (1,18,19,20,21,22,23,24,25) AND `modResource`.`published` = 1 AND `modResource`.`deleted` = 0 )  ORDER BY modResource.publishedon DESC LIMIT 1 "
0.0001550: SQL executed
0.0001361: Total rows: 0
0.0000169: Rows fetched
0.0000391: Prepared and processed TVs
0.0000010: Returning processed chunks
0.0073311: Total time
13 631 488: Memory usage
]]>
https://forums.modx.com/thread/92071/pdoresources-and-tvfilters?page=2#dis-post-559282 Thu, 28 Jun 2018 05:25:53 +0000 https://forums.modx.com/thread/92071/pdoresources-and-tvfilters?page=2#dis-post-559282
<![CDATA[getResources to pdoResources]]> https://forums.modx.com/thread/103661/getresources-to-pdoresources#dis-post-557621 pdoTools 2.11.0

I'm in the process of moving from getResources and getPage to pdoTools.

I have three unique getPage calls on one page, each one corresponds to a specific folder (category) of resources which it correctly displays. Everything works great with getPage. But after switching to pdoPage the pagination breaks.

When a pagination link is clicked (e.g., 2, 3, Next etc.) the page reloads with the correct url (e.g., mysite.com/overview.html?page=2) in the browser address bar but the page (and url) that loads goes back to page one. It won't let me view any other page other than the first one.

I use pdoPage with pagination successfully elsewhere on the same site so I know it works, just not on this particular page.

After some poking around it seems the problem has to do with the multiple calls on one page. With only one pdoPage call on the page the pagination works exactly as expected, but as soon as I add more calls the pagination breaks again.

As I said, it's been working fine with multiple getPage calls so I don't understand what's happening with pdoPage.

Call One:
[[!pdoPage@pdoPagination?
    &elementClass=`modSnippet`
    &element=`pdoResources`
    &parents=`2`
    &resources=`-1`
    &includeTVs=`1`
    &where=`{"createdby:=":[[!+modx.user.id]]}`
    &showHidden=`1`
    &sortby=`publishedon`
    &sortdir=`DESC`
    &tpl=`ArticleResult`
    &hideContainers=`1`
    &limit=`5`
    &pageLimit=`5`
    &toPlaceholder=`articleResult`
    &totalVar=`articlePublished`
    &pageNavVar=`page.nav.article`
    &showUnpublished=`1`
]]

Call Two:
[[!pdoPage@pdoPagination?
    &elementClass=`modSnippet`
    &element=`pdoResources`
    &parents=`3`
    &resources=`-1`
    &includeTVs=`1`
    &where=`{"createdby:=":[[!+modx.user.id]]}`
    &showHidden=`1`
    &sortby=`publishedon`
    &sortdir=`DESC`
    &tpl=`ReviewResult`
    &hideContainers=`1`
    &limit=`5`
    &pageLimit=`5`
    &toPlaceholder=`reviewResult`
    &totalVar=`reviewPublished`
    &pageNavVar=`page.nav.reviews`
    &showUnpublished=`1`
]]

Call Three:
[[!pdoPage@pdoPagination?
    &elementClass=`modSnippet`
    &element=`pdoResources`
    &parents=`4`
    &resources=`-1`
    &includeTVs=`1`
    &where=`{"createdby:=":[[!+modx.user.id]]}`
    &showHidden=`1`
    &sortby=`publishedon`
    &sortdir=`DESC`
    &tpl=`TutorialResult`
    &hideContainers=`1`
    &limit=`5`
    &pageLimit=`5`
    &toPlaceholder=`tutorialResult`
    &totalVar=`tutorialPublished`
    &pageNavVar=`page.nav.tutorials`
    &showUnpublished=`1`
]]
]]>
https://forums.modx.com/thread/103661/getresources-to-pdoresources#dis-post-557621 Sat, 24 Mar 2018 04:02:07 +0000 https://forums.modx.com/thread/103661/getresources-to-pdoresources#dis-post-557621
<![CDATA[getPage Link Not Working]]> https://forums.modx.com/thread/103649/getpage-link-not-working#dis-post-557553
I was making some edits unrelated to getResources / getPage after which the generated links now point to the homepage instead of the individual resource(s). Other than the link issue the getPage call returns the correct results.

Also, I use getPage elsewhere and those links work fine so whatever the problem it seems to only affect the pages where the below call is used.

getPage call
[[!getPage@Pagination?
	&element=`getResources`
	&elementClass=`modSnippet`
	&tpl=`CategoryRow`
	&hideContainers=`1`
	&pageVarKey=`page`
	&parents=`[[*id]]`
	&includeTVs=`1`
	&includeContent=`1`
	&limit=`6`
    &pageLimit=`5`
    &pageNavVar=`page.nav`
]]


The generated link incorrectly points to the homepage.
<a href="[[~[[+id]]]]">[[+pagetitle]]</a>
]]>
https://forums.modx.com/thread/103649/getpage-link-not-working#dis-post-557553 Wed, 21 Mar 2018 11:24:03 +0000 https://forums.modx.com/thread/103649/getpage-link-not-working#dis-post-557553
<![CDATA[How can I group my resources by TV (date)?]]> https://forums.modx.com/thread/99175/how-can-i-group-my-resources-by-tv-date#dis-post-556401

  • 01.01.2016 - new year's lunch (meetings)
  • 11.12.2015 - writing class (classes)
  • 01.12.2015 - trip to London (trips)
  • 23.11.2015 - french class (classes)

I can sort them by tags:

  • classes
  • meetings
  • trips

It works very well. This is my code:

           [[!getResourcesTag?
  						&parents=2`  
  						&tagKey=`Tags` 
  						&showHidden=`1`
  						&tpl=`datesTpl
  						&limit=`3`
  						&includeContent=`1`
  						&includeTVs=`1`
  						&processTVs=`1`
  						&tvPrefix=`` 
  						&hideContainers=`1`
  						&pageLimit=`10`	
					]]


Now comes the part, that makes problems to me. I want to group the result by month. So the result I would like to achieve is:

January 2016
---------------

  • 01.01.2016 - new year's lunch (meetings)

December 2015
------------------

  • 11.12.2015 - writing class (classes)
  • 01.12.2015 - trip to London (trips)

November 2015
------------------

  • 23.11.2015 - french class (classes)


The TV, that outputs the date has the name "date". This TV gives me for every entry a timestamp output. For example: "2015-12-11 00:56:00".
I wrote a snippet (formatDate), that outputs me later the format I wish. I use it like this:
[[formatDate? &date=`[[+date]]`]]


So I thought I could use Archivist Grouper for that issue. But it is not working. Somehow it doesn't process my TVs. Here is my code:
[[!ArchivistGrouper? &parents=`2` &itemTpl=`datesTpl` &includeTVs=`1` &tvPrefix=`` &includeContent=`1` &processTVs=`1`]]


My result with Archivist Grouper is:

January 2016
---------------

  • 01.01.2016 - new year's lunch ()

December 2015
------------------

  • 01.01.2016 - writing class ()
  • 01.01.2016 - trip to London ()

November 2015
------------------

  • 01.01.2016 - french class ()

So my question is, can I get the result I wish also with getResources? Or do you have any idea to get it run! I hope very much you can help. I am happy for every hint smiley]]>
https://forums.modx.com/thread/99175/how-can-i-group-my-resources-by-tv-date#dis-post-556401 Wed, 17 Jan 2018 05:31:47 +0000 https://forums.modx.com/thread/99175/how-can-i-group-my-resources-by-tv-date#dis-post-556401
<![CDATA[Sorting getResources result by TV]]> https://forums.modx.com/thread/43575/sorting-getresources-result-by-tv?page=3#dis-post-553761
I’m new to modX, so forgive me if this is an easy question.

I’ve got a template variable called "quickCalendarStartDate" that’s a date field. I’m trying to use getResources to display a list of resources, sorted by this "quickCalendarStartDate" field. I’m using the following code:
[[!getResources? &parents=`[[*id]]` &tpl=`eventPosting` &includeContent=`1` &includeTVs=`1` &limit=`20` &sortby=`tv.quickCalendarStartDate` &sortdir=`ASC`]]


But when I run it, I get this error:
[2010-08-08 12:53:57] (ERROR @ /mpca/index.php) Error 42S22 executing statement: Array ( [0] => 42S22 [1] => 1054 [2] => Unknown column 'tv.quickCalendarStartDate' in 'order clause' )


Without the "sortby" parameter it works fine (but of course sorts by "publishedon"). If I also remove the "tpl" parameter and look at the raw array being returned, it includes:
    [tv.quickCalendarStartDate] => 2010-07-17 00:00:00


So I know the TV is there. Am I using the "sortby" parameter incorrectly?
]]>
https://forums.modx.com/thread/43575/sorting-getresources-result-by-tv?page=3#dis-post-553761 Fri, 08 Sep 2017 02:53:00 +0000 https://forums.modx.com/thread/43575/sorting-getresources-result-by-tv?page=3#dis-post-553761
<![CDATA[Daterange How to display custom output with getPage]]> https://forums.modx.com/thread/102680/daterange-how-to-display-custom-output-with-getpage#dis-post-553151
Im using getPage and it works fine for single dates (screenshot date1.png)



When it comes to a daterange, it comes up blank. (screenshot date2.png)



Here is my chunk:


						<div class="entry clearfix">
							<div class="entry-image">
								<a href="[[~[[+id]]]]">
									<img src="[[phpthumbOn? &input=`[[+image_2]]` &options=`&w=300&h=200&zc=1`]]" alt="[[+pagetitle]]">
									<div class="entry-date">[[+lounge_dates:strtotime:date=`%d`]]<span>[[+lounge_dates:strtotime:date=`%b`]]</span></div>
								</a>
							</div>
							<div class="entry-c">
								<div class="entry-title">
									<h2><a href="[[~[[+id]]]]">[[+pagetitle]]</a></h2>
								</div>
								<ul class="entry-meta clearfix">

									<li><i class="icon-time"></i> [[+time]]</li>
								
								</ul>
								<div class="entry-content">
									<p>[[+description]]</p>
									<a href="[[~[[+id]]]]" class="btn btn-danger">Read More</a>
								</div>
							</div>
						</div>



It works fine for single dates using only the first datepicker in the TV. Im hoping to have it show the days with this as an example
5-6
Sep

I hope I didnt forget anything and I thank you for your time.]]>
https://forums.modx.com/thread/102680/daterange-how-to-display-custom-output-with-getpage#dis-post-553151 Sat, 12 Aug 2017 01:08:47 +0000 https://forums.modx.com/thread/102680/daterange-how-to-display-custom-output-with-getpage#dis-post-553151
<![CDATA[Using getResources to display JSON data - returning correct amount of items but only uses data from the 1st resource]]> https://forums.modx.com/thread/102608/using-getresources-to-display-json-data---returning-correct-amount-of-items-but-only-uses-data-from-the-1st-resource?page=3#dis-post-552988
I've got a getResources call returning data in JSON format - this culls its data from resources with content type JSON. The correct amount of items are being returned but the data (from TV's) is only being returned from the first resource.

What I'm trying to achieve is a JSON list for google map markers - this works fine outside of MODX in vanilla JS with the maps API so I'm attempting to transpose it into a MODX format. I don't really want to use an Extra for this for a number of reasons.

I've read up about this and think I'm doing it right ... https://forums.modx.com/thread/100338/using-snippet-and-getresources-in-external-javascript

Here's the getResources call, which is inside a <script> tag:
xyz javascript ... (all working) ...
...
var locations = [
	[[getResources? &parents=`26` &showHidden=`0` &hideContainers=`1` &tpl=`tpl.wrapper-GMapVars` &tplLast=`tpl.wrapper-GMapVars-Tail` &showHidden=`1` &includeTVs=`1` &processTVs=`1` &depth=`1` &limit=`20`]]
]


Here's the templates used in the GR call.
tpl.wrapper-GMapVars and tpl.wrapper-GMapVars-Tail are identical but 'GMapVars-Tail' omits trailing comma for correct JSON syntax, and both use a chunk for the TV's/JSON object properties:
{
lat: [[+tv.map-latitude]],
lng: [[+tv.map-longitude]],
info: '<div class="info_content">'+
'<h3>[[+tv.map-location]]</h3>'+
'<p>[[+tv.map-description]]</p>'+
'</div>'
},

This renders correctly within a <script> call, i.e. it renders 3 JSON objects from the 3 resources in id:26. However, the data in each of the 3 JSON objects is from the 1st resource only.

Can anyone see what's wrong here??? How can I get the data from the resources to render in their respective JSON objects?

Hope I've written this clearly, thanks in advance.]]>
https://forums.modx.com/thread/102608/using-getresources-to-display-json-data---returning-correct-amount-of-items-but-only-uses-data-from-the-1st-resource?page=3#dis-post-552988 Thu, 03 Aug 2017 09:27:57 +0000 https://forums.modx.com/thread/102608/using-getresources-to-display-json-data---returning-correct-amount-of-items-but-only-uses-data-from-the-1st-resource?page=3#dis-post-552988
<![CDATA[GetResources showing parent and not children]]> https://forums.modx.com/thread/43697/getresources-showing-parent-and-not-children#dis-post-552471
Im doing a really basic Getresources call and it is only showing the container and not the child.

How can I make it not show the container at all and show all children. Any assistance appreciated.

[[!getResources? &parents=`[[*id]]` &limit=`10` &tpl=`answerSummary`]]

]]>
https://forums.modx.com/thread/43697/getresources-showing-parent-and-not-children#dis-post-552471 Thu, 13 Jul 2017 11:17:44 +0000 https://forums.modx.com/thread/43697/getresources-showing-parent-and-not-children#dis-post-552471
<![CDATA[getResources returning nothing/zero, but is set up correctly on a fresh install. Is this a server config issue? Error logs included]]> https://forums.modx.com/thread/102530/getresources-returning-nothing-zero-but-is-set-up-correctly-on-a-fresh-install-is-this-a-server-config-issue-error-logs-included?page=2#dis-post-552410
I'm getting zero/zilch/nothing in return from a getResources call on a completely fresh install - getResources is the only extra in place (TinyMCE aside) and I'm pretty sure I've got my getResources call etc set up correctly. I've tried the call both cached and uncached.

There are 3 pages at root level in the document tree and they're all using the default MODX template as it stands. All pages load fine.

Straight away after installing and testing getResources I got error logs, but there were none with the fresh install.

I'm wondering if this is an inherent server config issue - I'm running on a TSO Host VPS/CPanel setup. I've never had any issues with TSO before but that was always on their Cloud/shared servers, never a VPS.

I'm reaching the server via my hostfile - it's not got any domain name DNS pointing at it at this stage. I can't imagine that would affect getResources but add it for completion.

Here's the setup:
MODX Revolution: 2.5.7-pl (traditional)
PHP Version: 5.6.30
MySQL Client API version: mysqlnd 5.0.11-dev (from phpinfo file)
Database client version: libmysql - 5.1.73 (from phpMyAdmin)
Server version: 5.6.35 - MySQL Community Server (GPL) (from phpMyAdmin)
Protocol version: 10
cPanel & WHM 64.0 (build 30)

The getResources call:
[[getResources? &showHidden=`1` &tpl=`pagesTpl` &debug=`1`]]

Content of pagesTpl:
[[*pagetitle]]
Fluffed Up Beyond All Recognition

Here's the MODX error log (I replaced the actual server name with 'servername'):
[2017-07-11 10:12:33] (ERROR @ /home/servername/public_html/core/cache/includes/elements/modsnippet/1.include.cache.php : 201) context for 1 is web
[2017-07-11 10:12:33] (ERROR @ /home/servername/public_html/core/cache/includes/elements/modsnippet/1.include.cache.php : 427) SELECT `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` FROM `modx_site_content` AS `modResource` WHERE  ( modResource.parent IN (1) AND `modResource`.`deleted` = 0 AND `modResource`.`published` = 1 )  ORDER BY publishedon DESC LIMIT 5

Can anyone see anything glaringly obvious here?

Many thanks in advance.]]>
https://forums.modx.com/thread/102530/getresources-returning-nothing-zero-but-is-set-up-correctly-on-a-fresh-install-is-this-a-server-config-issue-error-logs-included?page=2#dis-post-552410 Tue, 11 Jul 2017 05:30:52 +0000 https://forums.modx.com/thread/102530/getresources-returning-nothing-zero-but-is-set-up-correctly-on-a-fresh-install-is-this-a-server-config-issue-error-logs-included?page=2#dis-post-552410
<![CDATA[getResources doesn't display/update custom TVs]]> https://forums.modx.com/thread/102123/getresources-doesn-t-display-update-custom-tvs#dis-post-550425
Need your help - can't figure out what to do.

The thing is there is a website that have worked quite perfectly for many months until recently. Last week I noticed that browsers don't display images and texts from resources, lines with code are just left blank. The problem is only with custom TVs; *pagetitle, *alias, *content, etc. work correctly.

First I thought there must be a problem with caching, but then I tried to create a new resource by duplicating an existing one and find out that the system can't really update info for custom TVs (with *pagetitle, *alias, *content again there is no problem, information was updated and displayed). So now I think the problem has something to do with database, but can't really figure out where to start.

Please advise me smiley]]>
https://forums.modx.com/thread/102123/getresources-doesn-t-display-update-custom-tvs#dis-post-550425 Tue, 02 May 2017 11:45:55 +0000 https://forums.modx.com/thread/102123/getresources-doesn-t-display-update-custom-tvs#dis-post-550425
<![CDATA[Synchronize 2 Getresources Calls]]> https://forums.modx.com/thread/102086/synchronize-2-getresources-calls#dis-post-550317 https://forums.modx.com/thread/102086/synchronize-2-getresources-calls#dis-post-550317 Thu, 27 Apr 2017 03:33:13 +0000 https://forums.modx.com/thread/102086/synchronize-2-getresources-calls#dis-post-550317 <![CDATA[getPage pagination not working when getPage call is cached]]> https://forums.modx.com/thread/102048/getpage-pagination-not-working-when-getpage-call-is-cached#dis-post-550086
I have a getPage call which includes pagination as per the example code below. This all works fine when I call the getPage call uncachned - but, to speed up page load, I want to call it cached - if I do this, the pagination does not work - clicking on the 2nd page button brings up the 1st page - it just plain and simply does not work...

Can the pagination not work if the getPage call is cached???

[[!getPage?
   &elementClass=`modSnippet`
   &element=`getResources`
   &parents=`20,32,305`
   &limit=`12`
   &pageVarKey=`page`
   &includeTVs=`1`
   &processTVs=`1`
   &includeContent=`1`
   &tpl=`NewsArticleTpl`
   &tvPrefix=``
   &sortby=`{"publishedon":"DESC"}`
   &showHidden=`1`
   &pageNavVar=`Both.nav`
   &includeTVList=`myTVs`
    ]]


    <div class="paging">
    <ul class="pageList">
    [[+Both.nav]]
    </ul>
    </div>


Anyone any ideas?

e.g. changing the code to below means the pagination fails:

[[getPage?
   &elementClass=`modSnippet`
   &element=`getResources`
   &parents=`20,32,305`
   &limit=`12`
   &pageVarKey=`page`
   &includeTVs=`1`
   &processTVs=`1`
   &includeContent=`1`
   &tpl=`NewsArticleTpl`
   &tvPrefix=``
   &sortby=`{"publishedon":"DESC"}`
   &showHidden=`1`
   &pageNavVar=`Both.nav`
   &includeTVList=`myTVs`
    ]]


    <div class="paging">
    <ul class="pageList">
    [[+Both.nav]]
    </ul>
    </div>

]]>
https://forums.modx.com/thread/102048/getpage-pagination-not-working-when-getpage-call-is-cached#dis-post-550086 Thu, 13 Apr 2017 12:06:07 +0000 https://forums.modx.com/thread/102048/getpage-pagination-not-working-when-getpage-call-is-cached#dis-post-550086
<![CDATA[Getresources to display chunk depending on TV (and default tpl)]]> https://forums.modx.com/thread/101911/getresources-to-display-chunk-depending-on-tv-and-default-tpl#dis-post-549514
The outcome I am hoping to do:

Getresource displays different chunk that depends on TV. If "tv A" is selected, getResources displays "chunk A". If "tv B" is selected, getresources displays "chunk B".

Thank you for your time.]]>
https://forums.modx.com/thread/101911/getresources-to-display-chunk-depending-on-tv-and-default-tpl#dis-post-549514 Sun, 19 Mar 2017 10:24:26 +0000 https://forums.modx.com/thread/101911/getresources-to-display-chunk-depending-on-tv-and-default-tpl#dis-post-549514
<![CDATA[where = empty field get a wrong result]]> https://forums.modx.com/thread/101714/where-empty-field-get-a-wrong-result?page=2#dis-post-548640
In my getPage call, I have:
&where=`{"datestart:>=":"[[!today]]"},{"OR:dateend:>=":"[[!today]]"}`


But, if `dateend`is empty, I have all results.

Of course, this code work perfectly:
&where=`{"datestart:>=":"[[!today]]"}`


Help!]]>
https://forums.modx.com/thread/101714/where-empty-field-get-a-wrong-result?page=2#dis-post-548640 Thu, 09 Feb 2017 09:02:59 +0000 https://forums.modx.com/thread/101714/where-empty-field-get-a-wrong-result?page=2#dis-post-548640
<![CDATA[getResources "row tpl"?]]> https://forums.modx.com/thread/97391/getresources-row-tpl#dis-post-547954
<div class="row">
     <div class="item">Item 1</div>
     <div class="item">Item 2</div>
     <div class="item">Item 3</div>
     <div class="item">Item 4</div>
</div>

<div class="row">
     <div class="item">Item 5</div>
     <div class="item">Item 6</div
</div>


Note that each row contains at the most four elements, and that there may be a row at the end with fewer than four elements.

My question is: How is this "row" structure best achieved with getResources? After going through the documentation, the best I can find is a template selector for every nth item. This doesn't quite work for me, though, because I need both opening and closing markup. The closest I can come is to add
<div class="row">
to the 1st, 5th etc items and an extra
</div>
after the 4th, 8th, etc... the problem being that if the number of items isn't divisible by 4, I'll end up missing a closing tag.

Any thoughts?]]>
https://forums.modx.com/thread/97391/getresources-row-tpl#dis-post-547954 Wed, 11 Jan 2017 09:42:34 +0000 https://forums.modx.com/thread/97391/getresources-row-tpl#dis-post-547954
<![CDATA[GetResources pagination problem on next pages]]> https://forums.modx.com/thread/101449/getresources-pagination-problem-on-next-pages#dis-post-547360
[[!getPage? 

&elementClass=`modSnippet` 
&element=`getResources` 
&parents=`100`  
&limit=`9` 

&pageVarKey=`page` 

&includeTVs=`1`  
&processTVs=`1` 
&showHidden=`1` 
&includeContent=`1` 
&sortby=`menuindex` 
&sortdir=`ASC` 
&hideContainers=`1` 
 
&pageFirstTpl=`<li class="control"><a[[+classes]][[+title]] href="[[+href]]">First</a></li>` 
&pageLastTpl=`<li class="control"><a[[+classes]][[+title]] href="[[+href]]">Last</a></li>` 

&tpl_n3=`tplCloseRow` 
&tplLast=`tplLastRow`
&tplFirst = `tplFirstRow` 
&tpl=`photosTpl` 
]] 

<div class="paging"> <ul class="pageList pagination"> [[!+page.nav]] </ul> </div>
]]>
https://forums.modx.com/thread/101449/getresources-pagination-problem-on-next-pages#dis-post-547360 Thu, 15 Dec 2016 03:03:38 +0000 https://forums.modx.com/thread/101449/getresources-pagination-problem-on-next-pages#dis-post-547360
<![CDATA[GetResources and &tpl_n4 cust results]]> https://forums.modx.com/thread/101321/getresources-and-tpl-n4-cust-results#dis-post-546851 I have 6 items in folder (129). If I use &tpl_n4 to break row in my results (3 per row), I got only 4 items.
When delete this part "&tpl_n4=`tplCloseRow` &tplLast=`tplLastRow`" - I got every 6 items. Why?

<div class="row">
[[!getResources:default=`No results found`? &showHidden=`1` &parents=`129`  
 &tpl=`fotografieTpl` &tpl_n4=`tplCloseRow` &tplLast=`tplLastRow` &includeTVs=`1` &processTVs=`1` &includeContent=`1` 
&debug=`1` &limit=`100` &sortby=`menuindex` &sortDir=`ASC`
]]


tplLast
</div>


tplCloseRow
</div>
<div class="row" style="margin-top: 20px">
]]>
https://forums.modx.com/thread/101321/getresources-and-tpl-n4-cust-results#dis-post-546851 Wed, 30 Nov 2016 05:47:23 +0000 https://forums.modx.com/thread/101321/getresources-and-tpl-n4-cust-results#dis-post-546851
<![CDATA[Re: IDX condition in a getresource tpl]]> https://forums.modx.com/thread/101259/re-idx-condition-in-a-getresource-tpl#dis-post-546456
Can you describe what you're seeing now and what you want to see instead?]]>
https://forums.modx.com/thread/101259/re-idx-condition-in-a-getresource-tpl#dis-post-546456 Wed, 16 Nov 2016 10:10:52 +0000 https://forums.modx.com/thread/101259/re-idx-condition-in-a-getresource-tpl#dis-post-546456