We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36592
    • 970 Posts
    [[firstChildForward&docid=`2`]]
    

    This should be...
    [[firstChildForward? &docid=`2`]]
    

      • 18052
      • 8 Posts
      Hi,

      sorry, this was clearly my error because i didnt RTFM rolleyes

      But now i get this error message:

      « MODx Parse Error »
      MODx encountered the following error while attempting to parse the requested resource:
      « PHP Parse Error »
       
      PHP error debug
        Error: 	array_key_exists() [function.array-key-exists]: The first argument should be either a string or an integer	 
        Error type/ Nr.: 	Warning - 2	 
        File: 	/home/.sites/153/site82/web/manager/includes/document.parser.class.inc.php	 
        Line: 	923	 
        Line 923 source: 	if (!is_numeric($identifier) && array_key_exists($identifier, $this->documentListing)) { 	 
       
      Parser timing
        MySQL: 	0.0108 s	(7 Requests)
        PHP: 	0.0518 s	 
        Total: 	0.0626 s
      


      Maybe i can work around that this way:
      i have a TV for holding the ID of the parent node.
      Is there a suitable API function for getting the value of a certain TV inside the snippet?
      This way i could omit the docid parameter in the snippet call, maybe there is a problem with the
      &
      inside the editor window of the parent node page?

      please help!

      best regards,
      makro
        • 36592
        • 970 Posts
        I don’t know mush about PHP, but in this code...
        $firstChild= $children[0];

        $children[0] is still an array.
        The id of desired document is something like...
        $firstChild= $children[0]['id'];

        but I’m not sure... undecided
          • 18052
          • 8 Posts
          Hi,

          allright.
          Since getActiveChildren() is not documented, i resolved the issue by reading up the documentation on getDocumentChildren():

          array getDocumentChildren($id=-1, $active=1, $deleted='0', $fields='id, pagetitle, description, alias, parent');
          


          From here its clearly visible, that the ID is in $children[0][’id’].
          Thanks anyway, tkfm smiley

          thx & regards,
          makro