We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10940
    • 71 Posts
    Writing a snippet and I would like to get the pagetitles of the document ids I receive as parameters.
    How do I go about accessing the pagetitle?

    I dont want to rely on existing snippets that provide more functionality than I require (i.e. getField)

    Thanks heaps,
    Global
      • 4310
      • 2,310 Posts
      Taken from the Wiki.
      $modx->getDocument($id, $fields, $published, $deleted);
      /*
      // $doc = $modx->getDocument(6, '*', 1);
      // $doc = $modx->getDocument(6, 'id,pagetitle', 1);
      // output: $doc['id']
      */
        • 34361
        • 2 Posts
        Appreciate the info, it’s good to know.