We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28107
    • 230 Posts
    The following call ignores my TV.
    If I change &fields for example to introtext, everything works.

    My TV 'tags' is a simple text field.

    Any suggestions are appreciated.
    [[getRelated?
     &parents=`1,10,100`
     &limit=`5`
     &includeHidden=`0`
     &hideContainers=`0`
     &fields=`tv.tags:1`
     &returnFields=`pagetitle,longtitle,introtext,content` 
     &tplOuter=`t_getrelated_outer`
     &tplRow=`t_getrelated_row`
     &noResults=`noting found`
     &debug=`0`
    ]]

    as of my understanding:
    field == source of my search query (or my keywords, I'm looking for
    returnFields == the places where to search for my keywords.

    (System 2.2.6 - all scripts updated)
    edith: removed bold /bold from code

    This question has been answered by paulp. See the first response.

    [ed. note: spackko last edited this post 13 years, 9 months ago.]
      CONIN Werbeagentur . Köln
      http://www.conin.de
    • discuss.answer
      • 22840
      • 1,572 Posts
      Try replacing returnFields with returnTVs

      http://rtfm.modx.com/display/ADDON/getRelated

        • 28107
        • 230 Posts
        nope - no result.

        Hmm, after reading again the RTFM:

        Is that correct, that the syntax is:

        take tv.tags, eleminate stopwords, separate each word
        search with that result in pagetitle,introtext,content.. in documents 1,10, and below

        (that works as expected with eg. introtext, but not with a TV.)

        so,
        Try replacing returnFields with returnTVs
        makes no sense to me
          CONIN Werbeagentur . Köln
          http://www.conin.de
          • 28107
          • 230 Posts
          update: lookig at a log is a good idea...

          [2012-12-13 15:05:44] (ERROR @ /index.php) Error 42S22 executing statement:
          Array
          (
          [0] => 42S22
          [1] => 1054
          [2] => Unknown column 'Resource.tags' in 'field list'
          )

          Hm, any idea?
            CONIN Werbeagentur . Köln
            http://www.conin.de
            • 18373 ☆ A M B ☆
            • 3,141 Posts
            You're misunderstanding &fields and &returnFields.

            &fields is where the match data comes from. It looks at those fields and/or tvs and gets the unique words. For matching other resources, it uses the same fields.

            &returnFields defines what resource fields are available as placeholders in the output. &returnTVs definez what TVs are available in the output.

            Try enabling debug and verifying it is finding any matchdata (unique words) at all
              Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

              Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
              • 28107
              • 230 Posts
              Quote from: markh at Dec 13, 2012, 11:52 AM
              You're misunderstanding &fields and &returnFields.

              &fields is where the match data comes from. It looks at those fields and/or tvs and gets the unique words. For matching other resources, it uses the same fields.

              &returnFields defines what resource fields are available as placeholders in the output. &returnTVs definez what TVs are available in the output.

              Try enabling debug and verifying it is finding any matchdata (unique words) at all

              ah, thx for clearing that.
                CONIN Werbeagentur . Köln
                http://www.conin.de