I've been using the getParentField snippet (thank you @BobRay
) to help serve the page top content in a Revo 2.3.1-pl site.
<section class="page-top">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2><strong>[[!getParentField? &field=`pagetitle`]]</strong></h2>
<p class="page-top-description">[[!getParentField? &field=`introtext`]]</p>
</div>
</div>
</div>
</section>
All is well until I enable jquery.pjax (
https://github.com/defunkt/jquery-pjax) to ajax load partial page content; when trying to load certain pages, a 'Fatal error: Call to a member function get() on a non-object ... on line 3'
$parentObj = $modx->getObject('modResource', $modx->resource->get('parent'));
is returned.
Been attempting to fix this for a while so any ideas very welcome. Thank you!