<![CDATA[ pdoField Parent Resource - My Forums]]> https://forums.modx.com/thread/?thread=103820 <![CDATA[pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource?page=2#dis-post-558352
Using a Chunk that returns the SimpleSearch results row I'm trying to include the pagetitle of the (ultimate) parent of each result. Regardless of search criteria there are only 3 possible parent options (resources 2, 3, and 4) at the site root.

I've tried pdoField, UltimateParent and getResourceField but none of them return the correct (ultimate) parent of the search result.]]>
todd.b May 04, 2018, 02:55 AM https://forums.modx.com/thread/103820/pdofield-parent-resource?page=2#dis-post-558352
<![CDATA[Re: pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource?page=2#dis-post-558409 ]]> BobRay May 07, 2018, 04:44 AM https://forums.modx.com/thread/103820/pdofield-parent-resource?page=2#dis-post-558409 <![CDATA[Re: pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558395 not have been able to figure that one out.

Thank you very much, Bob.]]>
todd.b May 06, 2018, 06:27 AM https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558395
<![CDATA[Re: pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558394 BobRay May 06, 2018, 04:40 AM https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558394 <![CDATA[Re: pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558393 todd.b May 06, 2018, 03:41 AM https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558393 <![CDATA[Re: pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558392 BobRay May 06, 2018, 03:39 AM https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558392 <![CDATA[Re: pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558391
I think I'll put this one on the backburner. It's not critical. Thank you for trying.]]>
todd.b May 06, 2018, 03:30 AM https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558391
<![CDATA[Re: pdoField Parent Resource (Best Answer)]]> https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558390
Here's a wild guess at what you need.

<div class="sisea-result">
    <h3>[[+idx]]. <a href="[[+link:is=``:then=`[[~[[+id]]]]`:else=`[[+link]]`]]" title="[[+longtitle]]">[[+pagetitle]]</a></h3>
    <div class="extract"><p>[[+extract]]</p></div>
    <p>Parent Pagetitle: [[!ParentPagetitle? &docId=`[[+id]]` ]]</p>
</div>



/* ParentPagetitle snippet */

$docId = $modx->getOption('docId', $scriptProperties, '');
$output = 'Not Found';
if (!empty($docId)) {
    $uParent = $modx->runSnippet('UltimateParent', array('topLevel' =>1, 'id' => $docId));
    $parent = $modx->getObject('modResource', (int) $uParent);
    $output =  $parent->get('pagetitle');
}
return $output;




]]>
BobRay May 05, 2018, 09:55 PM https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558390
<![CDATA[Re: pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558373
Too bad since UltimateParent and pdoField each work great under other more normal circumstances.

Ok, for the moment let's say there's no way to get it working with UltimateParent. What about this... what about creating a breadcrumb for each result (using pdoCrumbs)? Or would what just be more of the same problem?]]>
todd.b May 05, 2018, 04:51 AM https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558373
<![CDATA[Re: pdoField Parent Resource]]> https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558372
You could have a custom snippet, but I'm not sure how you would send it the Simple Search result ID.]]>
BobRay May 05, 2018, 04:43 AM https://forums.modx.com/thread/103820/pdofield-parent-resource#dis-post-558372