We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    I got the folloing error using a cobination of getField and SectionRoots this way:

    [!GetField? &docid=[[SectionRoots?Sec_roots=7,41,46,70,80,85]]!]

    Fatal error: Call to undefined function: gettv() in /home/httpd/vhosts/1-vision.nl/subdomains/kingskids/httpdocs/manager/includes/document.parser.class.inc.php(729) : eval()’d code on line 292


    I use sectionroots also in dropmenu and wayfinder without any problems.
      follow me on twitter: @dimmy01
      • 36541
      • 222 Posts
      Quote from: Dimmy at Nov 16, 2006, 07:07 AM

      I got the folloing error using a cobination of getField and SectionRoots this way:

      [!GetField? &docid=[[SectionRoots?Sec_roots=7,41,46,70,80,85]]!]

      Which version of GetField do you use?

      I haven’t used SectionRoots, however, it looks like you are trying to get a pagetitle of a parent document. The root document for a section, actually.

      You can do it easily with GetField alone. You just have to make a call like that:

      [!GetField? &parent=`1`!]


      This will return a pagetitle of the ultimate parent of the current document. The ultimate parent is the topmost document in the document tree, which is current document’s ancestor. In other words, the document in the root of the document tree, which is in the same branch as the current document.

      If your sections sit under a specific folder then you should provide &topid parameter with id of that folder.
        This is the web: the only thing you know about who will come is that you don't know who will come.
        • 7455
        • 2,204 Posts
        ok what i want is that it only shows the title of parent of the document when there is a submenu so if there is no submenu then no title thats why I use sectionroots to set the id that the parent has but the parent is also a child from level 1 and then I do not want to show the pagetitle. level1 is on top of the page level 2 is on the left en level 3 is on the right
        so only when levl 2 hase children and you are on e level3 page i want the title of the parent (level20 to be displayed above level3.

        if there is no level3 I do not want the title to be there
          follow me on twitter: @dimmy01
          • 36541
          • 222 Posts
          Generally I prefer to use the less snippets possible. That’s great in MODx, its flexibility. I would do this in other way.

          I would make a radio type TV, with default value set to empty and @INHERIT binding and bind it to a chunk including a call:

          [!GetField? &parent=`1` &topid=`level1id` &parentLevel=`3`!]


          Then for level 3 documents I would set it to that chunk (or use document groups for that). This way I would get the level 2 parent document pagetitle for all documents from levels 3-5 (&parentLevel).

          As to the error you reported, make sure you use the latest release of GetField (currently 1.2.2) or, please, test the beta.
            This is the web: the only thing you know about who will come is that you don't know who will come.
            • 24731 ☆ A M B ☆
            • 211 Posts
            Hi, I am using 1.2.2. I am trying to get the value from a TV, but I get error displayed:

            Fatal error: Call to undefined function: gettv() in /home/****/public_html/cms/manager/includes/document.parser.class.inc.php(748) : eval()’d code on line 147

            I am using: [!GetField? &docid=`[+id+]` &field=`ContentImage`!]

            Not sure if the syntax is wrong, ContentImage is my TV.
              • 6726
              • 7,075 Posts
              You should use [!GetField? &docid=`[*id*]` &field=`ContentImage`!] instead smiley

                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l'outil id
                • 24731 ☆ A M B ☆
                • 211 Posts
                Quote from: davidm at Apr 23, 2007, 07:18 PM

                You should use [!GetField? &docid=`[*id*]` &field=`ContentImage`!] instead smiley



                I had tried that before, it still does not work. I get the same error message.
                  • 24731 ☆ A M B ☆
                  • 211 Posts
                  Quote from: redstormj at Apr 23, 2007, 07:22 PM

                  Quote from: davidm at Apr 23, 2007, 07:18 PM

                  You should use [!GetField? &docid=`[*id*]` &field=`ContentImage`!] instead smiley



                  I had tried that before, it still does not work. I get the same error message.

                  Even if I hardcore the page ID and only request the TV in the call, I still get the error. If I pull any document object, it works fine, it only fails when trying to get the TV.

                  Jose
                    • 6726
                    • 7,075 Posts
                    GetField works fine for me with this kind of call and with TVs... there must be an explanation...Do you have the latest GetField ? Which MODx version are you running ?
                      .: COO - Commerce Guys - Community Driven Innovation :.


                      MODx est l'outil id
                      • 24731 ☆ A M B ☆
                      • 211 Posts
                      That’s weird then, I am running:

                      MODx version 0.9.5
                      Version codename rev 2106

                      And GetField version is: Version: 1.2.2

                      Here is the code where I am making the reference to GetField (its a chunk):

                      <!-- Weekly Pick -->
                      <div class="weekly_pick">
                      <!-- Blurb Image -->
                      <a href="[~[+id+]~]" title="[+title+]"><img src="[!GetField? &docid=`[+id+]` &field=`ContentImage`!]" alt="[+title+]" width="128" height="63" class="brdr_gray" /></a>
                      <!-- Blurb Content -->
                      <h2><a href="[~[+id+]~]" title="[+title+]"><span class="blurbcat">[!GetField? &docid=`[+parent+]`!]</span> [+title+]</a></h2><p>[+introtext+] <span class="more"><a href="[~[+id+]~]" title="[+title+]">more</a></span></p>
                      <!-- Blurb Content -->
                      </div>
                      <!-- Weekly Pick -->