# \[SOLVED\]\[Doodles + pdoTools\] Is it possible to get Doodles list with pdoTools?

**URL:** <https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144>\
**Category:** Extras\
**Tags:** pdoresources\
**Created:** [October 4, 2020, 1:05pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144 "2020-10-04T13:05:05Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tulavu](https://community.modx.com/letter_avatar_proxy/v4/letter/t/a3d4f5/32.png) [@tulavu](https://community.modx.com/u/tulavu)\
**Post date:** [October 4, 2020, 1:05pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/1 "2020-10-04T13:05:05Z")

</div>

Hi,

I have installed and set up the “Doodles” package.

doodles.schema.mysql.xml:

```auto
<?xml version="1.0" encoding="UTF-8"?>

<model package="doodles" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM">

	<object class="Doodle" table="wordsENG" extends="xPDOSimpleObject">
...
```

I have run the script build.schema.php and now the table `modx_wordsENG` is properly created, I also entered some dummy data inside of it.

My question is: what would be the best solution to retrieve these data and to display them into my modx resource.

I tried to use pdoResources, but it does not display nothing:

```auto
[[!pdoResources?
&loadModels=`wordsENG`
&class=`Doodle`
&tpl=`@INLINE <p>{{+id}} - {{+myfield}}</p>`
&showLog=`1`
]]
```

I have attempted different settings for pdoResources and it displays just nothing, even the &showLog does not output nothing. I have also tried the other snippets of pdoTools but without success as of today.

Thank you for the help ! 🙂

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [October 4, 2020, 1:56pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/2 "2020-10-04T13:56:01Z")

</div>

I believe the `&loadModels`-property has to be the name of your package.

```auto
[[!pdoResources?
&loadModels=`doodles`
&class=`Doodle`
&tpl=`@INLINE <p>{{+id}} - {{+myfield}}</p>`
&showLog=`1`
]]

```

---

<div class="post-metadata">

**Author:** ![tulavu](https://community.modx.com/letter_avatar_proxy/v4/letter/t/a3d4f5/32.png) [@tulavu](https://community.modx.com/u/tulavu)\
**Post date:** [October 4, 2020, 2:17pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/3 "2020-10-04T14:17:26Z")

</div>

Thank you @halftrainedharry, I already tried this and it didn’t help, I’m still trying to figure out what the problem is

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [October 4, 2020, 2:30pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/4 "2020-10-04T14:30:18Z")

</div>

If you put this code in a snippet an run it, do you see any output?

```auto
<?php
$base_path = $modx->getOption('core_path').'components/doodles/';
$modx->addPackage('doodles', $base_path.'model/');

$output = array();
$result= $modx->getCollection('Doodle');
foreach($result as $res){
    $output[] = $res->toArray();
}
return $modx->toJson($output);

```

---

<div class="post-metadata">

**Author:** ![tulavu](https://community.modx.com/letter_avatar_proxy/v4/letter/t/a3d4f5/32.png) [@tulavu](https://community.modx.com/u/tulavu)\
**Post date:** [October 4, 2020, 3:35pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/5 "2020-10-04T15:35:27Z")

</div>

Oh this is great yes I can see the output !

I’m going to try to find out why the pdoResource snippet is not working but still your answer helps me a lot 🙂 Thanks again @halftrainedharry !

---

<div class="post-metadata">

**Author:** ![halftrainedharry](https://community.modx.com/user_avatar/community.modx.com/halftrainedharry/32/1063_2.png) [@halftrainedharry](https://community.modx.com/u/halftrainedharry)\
**Post date:** [October 4, 2020, 3:39pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/6 "2020-10-04T15:39:45Z")

</div>

Have you check the error log? Maybe “pdoResource” puts something in there.

---

<div class="post-metadata">

**Author:** ![tulavu](https://community.modx.com/letter_avatar_proxy/v4/letter/t/a3d4f5/32.png) [@tulavu](https://community.modx.com/u/tulavu)\
**Post date:** [October 4, 2020, 3:48pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/7 "2020-10-04T15:48:59Z")

</div>

Yes i was just at the moment having a look at it and you are right:

[pdoTools] Error 42S22: Unknown column ‘publishedon’ in ‘order clause’

I’ll sort this out and update this post when I found the solution 🙂

---

<div class="post-metadata">

**Author:** ![tulavu](https://community.modx.com/letter_avatar_proxy/v4/letter/t/a3d4f5/32.png) [@tulavu](https://community.modx.com/u/tulavu)\
**Post date:** [October 4, 2020, 3:52pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/8 "2020-10-04T15:52:11Z")

</div>

I just added this to my snippet call and now it works fine :

```auto
&sortby=`id`
&sortdir=`asc`
```

Thank you for the help !

---

<div class="post-metadata">

**Author:** ![bruno17](https://community.modx.com/user_avatar/community.modx.com/bruno17/32/71_2.png) [@bruno17](https://community.modx.com/u/bruno17)\
**Post date:** [October 5, 2020, 2:01pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/9 "2020-10-05T14:01:35Z")

</div>

migxLoopCollection would also work

```auto
[[!migxLoopCollection?
&packageName=`doodles`
&classname=`Doodle`
&tpl=`@CODE:<p>{{+id}} - {{+myfield}}</p>`
]]

```

---

<div class="post-metadata">

**Author:** ![tulavu](https://community.modx.com/letter_avatar_proxy/v4/letter/t/a3d4f5/32.png) [@tulavu](https://community.modx.com/u/tulavu)\
**Post date:** [October 5, 2020, 3:10pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/10 "2020-10-05T15:10:04Z")

</div>

Good to know, thank you @bruno17

---

<div class="post-metadata">

**Author:** ![system](https://community.modx.com/user_avatar/community.modx.com/system/32/2_2.png) [@system](https://community.modx.com/u/system)\
**Post date:** [October 7, 2020, 3:10pm UTC](https://community.modx.com/t/solved-doodles-pdotools-is-it-possible-to-get-doodles-list-with-pdotools/3144/11 "2020-10-07T15:10:07Z")

</div>

Closed on October 7, 2020, 3:10pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
