We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27444 ☆ A M B ☆
    • 117 Posts
    How do I get the name of the resource instead of its index number using Ultimate Parent? smiley
      Steven James McLean
      Tech Lead
      springbokagency.com
      • 16702 ☆ A M B ☆
      • 536 Posts
      if you need to use PAGETITLE - try with this:

      [[GetField? &docid=`83` &field=`pagetitle`]]
        palma non sine pulvere
        • 5340
        • 1,624 Posts
        To get the title of the immediate parent use

        [[GetField? &parent=`1` &field=`pagetitle`]]
          • 27444 ☆ A M B ☆
          • 117 Posts
          No I cannot get the immediate parent ... I am using the Ultimate Parent Snippet to get the highest parent in the hierarchy.
            Steven James McLean
            Tech Lead
            springbokagency.com
            • 4310
            • 2,310 Posts
            [!GetField? &docid=`[[UltimateParent]]` &field=`pagetitle`!]
              • 5340
              • 1,624 Posts
              Get field should do that too

              Here is the documentation.


              /* Parameters
              ----------------------------------------------- */

              # $docid [ int ]
              # ID of the document for which to get a field content.
              # Default: current document

              $gfIntDocId = (isset($docid)) ? $docid : $modx->documentIdentifier;

              # $field [ string ]
              # Name of the field for which to get the content:
              # - any of the document object fields (http://modxcms.com/the-document-object.html)
              # - template variable
              # Default: ’pagetitle’

              $gfStrDocField = (isset($field)) ? trim($field) : ’pagetitle’;

              # $parent [ 0 | 1 ]
              # If set to 1, the snippet will return value for the document parent.
              # Default: 0

              $gfBoolParent = (isset($parent)) ? $parent : 0;

              # $parentLevel [ int ]
              # Specifies how high in the document tree to search for the parent of the document:
              # - $parentLevel = 0 - returns the ultimate parent (right under site root)
              # - $parentLevel = 1 - returns the direct parent
              # Default: 0

              $gfIntParentLevel = (isset($parentLevel) && is_int((int) $parentLevel)) ? $parentLevel : 0;

              # $topid [ int ]
              # Id of the topmost document in the document tree under which to search for a parent. Used only with $parent set to 1.
              # Default: 0

              $gfIntTopDocId = (isset($topid) && is_int((int) $topid)) ? $topid : 0;

              /* Do not edit the code below!
              ----------------------------------------------- */
                • 27444 ☆ A M B ☆
                • 117 Posts
                Excellent! Works perfectly laugh
                  Steven James McLean
                  Tech Lead
                  springbokagency.com