We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37946
    • 70 Posts
    I am getting the correct results back:
    
    <pre>Array
    (
        [tpl] => productDetailTpl
        [tplOdd] => 
        [tplFirst] => 
        [tplLast] => 
        [sortby] => publishedon
        [sortbyTV] => 
        [sortbyTVType] => string
        [sortbyAlias] => 
        [sortbyEscaped] => 0
        [sortdir] => DESC
        [sortdirTV] => DESC
        [limit] => 5
        [offset] => 0
        [tvFilters] => 
        [depth] => 10
        [parents] => 13
        [includeContent] => 1
        [includeTVs] => 1
        [includeTVList] => 
        [showHidden] => 
        [showUnpublished] => 
        [showDeleted] => 
        [resources] => 
        [processTVs] => 1
        [processTVList] => 
        [tvPrefix] => tv.
        [idx] => 2
        [first] => 1
        [last] => 2
        [toPlaceholder] => 
        [toSeparatePlaceholders] => 
        [debug] => 
        [where] => 
        [dbCacheFlag] => 0
        [context] => 
        [hideContainers] => 1
        [id] => 17
        [type] => document
        [contentType] => text/html
        [pagetitle] => ProductDetails
        [longtitle] => 
        [description] => 
        [alias] => 
        [link_attributes] => 
        [published] => 1
        [pub_date] => 0
        [unpub_date] => 0
        [parent] => 26
        [isfolder] => 
        [introtext] => 
        [content] => <p>This page will contain the two column layout.</p>
        [richtext] => 1
        [template] => 6
        [menuindex] => 1
        [searchable] => 1
        [cacheable] => 1
        [createdby] => 1
        [createdon] => 2012-05-30 12:06:55
        [editedby] => 1
        [editedon] => 2012-06-08 09:55:32
        [deleted] => 
        [deletedon] => 0
        [deletedby] => 0
        [publishedon] => 2012-05-30 12:06:00
        [publishedby] => 1
        [menutitle] => 
        [donthit] => 
        [privateweb] => 
        [privatemgr] => 
        [content_dispo] => 0
        [hidemenu] => 
        [class_key] => modDocument
        [context_key] => web
        [content_type] => 1
        [uri] => 
        [uri_override] => 0
        [hide_children_in_tree] => 0
        [show_in_tree] => 1
        [properties] => 
        [tv.productlogo] => /public/images/myimage.png
    )
    </pre>
    


    I don't get an array back if I don't provide "includeContent", "includeTVs" or "processTVs".

    but, the output is not what I am looking for:
    
    <div class="productlogo"></div>
    [[*content]]
    


    I am calling "getResources" from an external php file:

         $modx = new modX();
        $modx->initialize('web');
        $modx->getService('error','error.modError');
    
        $output = $modx->runSnippet('getResources',array(
            'parents'    => '13',
            'tpl'        => 'productDetailTpl',
            'hideContainers'  => '1',
            'includeContent'  => '1',
            'includeTVs'      => '1',
            'processTVs'     => '1'
        ));
    
    if ( $output != '' )
        {
            echo $output;
            error_log( $output );
        }
        else
        {
            echo 'failed';
            error_log('no output');
        }
    


    I'm not sure where I'm going wrong. Thank you!
      • 9102 ☆ A M B ☆
      • 318 Posts
      It's acting like it's not finding the template. Double-check the name of your chunk. If that's correct I'm not sure what's going on, but you could try using an inline template instead like this:

      $output = $modx->runSnippet('getResources',array(
              'parents'    => '13',
              'tpl'        => '@INLINE <div class="productlogo"></div> [[*content]]',
              'hideContainers'  => '1',
              'includeContent'  => '1',
              'includeTVs'      => '1',
              'processTVs'     => '1'
          ));