Did you try UltimateParent with &topLevel => `1` and &id = the search result ID?
[ed. note: BobRay last edited this post 8 years, 5 months ago.]
Does calling UltimateParent uncached help?
You could have a custom snippet, but I'm not sure how you would send it the Simple Search result ID.
No change with uncached.
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
discuss.answer
I don't think that would help, but I don't really understand what's happening.
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;
[ed. note: BobRay last edited this post 8 years, 5 months ago.]
Thanks Bob, as wild guesses go that was waaay better than anything I could come up with, unfortunately it didn't work.
I think I'll put this one on the backburner. It's not critical. Thank you for trying.
Todd
There was a mistake in the snippet. Can you give it another try?
Sure, what was the mistake?
Todd
Line 3 used 'id' rather than 'docId'. It's fixed above.