New Community Forums are coming. Watch this space for news.
Subscribe: RSS
  • haha wink graag gedaan.

    I worked around the bug by using custom tpl names. Thought is was something like that.. !
    • Hello!
      I try:
      [[getRelated? 
        &fields=`tv.tags:3`
        ]]

      But error... :
      Error collecting distinctive data from the resource to match against.
      What am I doing wrong?
      • There's not enough data in the current resource, in the fields you specified, to compare resources against.

        Perhaps your tags TV doesn't have any values, or the values it has are being stripped out as they are stop words (see the Lexicons at System -> Lexicons, getrelated namespace, "getrelated.stopwords" key) for words that are filtered out.

        I wouldn't advise just using a tags TV unless you add a lot of tags to every resource.On my new site I use something along the lines of pagetitle:4,introtext:2,tv.category:15 and am still fine-graining that for proper results.


        As a side note.. probably a new version coming out next week with some more fixes related to TVs and a case-sensitive search screwing things up and some more stuff I found and am working on fixing.
          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.
        • Thank you, but your method was not helpful, I did:
          [[getRelated? 
          &parents=`4` 
          &fields=`pagetitle:4,introtext:1,tv.tags:15` 
          &includeHidden=`false`]]

          Could this be due to the fact that my site is in Russian?
          I added a picture, which has the mine site.

          p.s. Sorry, I do not know much English, I use a translator.
          • Hmm can you try publishing those containers ("2011" and "10")? Can also try to get rid of &parents in your snippet call to make sure it's not a bug in there.

            What version of getRelated are you using? What error are you getting?
              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.
            • Just uploaded a new version to the Package Manager.

              Here's the changelog:
              ++++++++++++++++++++++++++++++++++++
              ++                                ++
              ++    getRelated 1.0.2-pl2        ++
              ++         Released: 10/11/2011   ++
              ++                                ++
              ++++++++++++++++++++++++++++++++++++
              (pl2) Fix bug which would include all resources if no resource fields are used in the &fields property.
              Fix bug which didn't filter out the current resource properly by refactoring the query.
              Make sure the debug data being spit out is actually usable and not just one blurb of data.
              Make sure tags are checked in a case insensitive manner to improve dataset. Fixes lack of results on some configurations.
              Fix bug that ignores ignoreHidden and ignoreUnpublished setting
                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.
              • New version now available

                New version released:

                ++++++++++++++++++++++++++++++++++++
                ++                                ++
                ++    getRelated 1.1.0-pl         ++
                ++         Released: 04/12/2011   ++
                ++                                ++
                ++++++++++++++++++++++++++++++++++++
                Add new exclude property to exclude specific resources from the output.
                Add new returnTVs property to include TV values in the snippet output. 
                  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.
                • I can't get this plugin to work for a new site I'm working on.

                  Maybe there is someone here who can help me with it?


                  This is my snippet call:
                      [[getRelated?
                        &resource=`current`
                        &fields=`tv.tags:1,longtitle:2`
                        &returnFields=`menutitle,longtitle,introtext`
                        &parents=`15`
                        &limit=`1`
                        &tplOuter=`tRelatedCasesOuterWidget`
                        &tplRow=`tRelatedCasesWidget`
                        &noResults=`Geen gerelateerde cases`
                        &debug=`0`
                      ]]


                  And I always get the noResult message with this snippet call!

                  I'm using the latest version of the snippet (1.1.0-pl)
                  Even if I make the tv.tags and the longtitle equal to the current resource.
                  • - Try without the &parents property, see if that gives you any results. If so you either set the &parents wrong or something else is up with that.
                    - Try without the &resource property - the default behavior is to use the current resource. While it is checking for that, I can't say I actually tested it with that property a lot as it's the default behavior.
                    - Enable debug (&debug=`1`) and post the results here.
                      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.
                    • Thanks for your reaction Mark,

                      This code is being outputted when I removed the &resource property and enabled debugging:
                      <strong>Resource Query</strong>:<br />SELECT `id`, `menutitle`, `longtitle`, `introtext` FROM `modx_site_content` AS `modResource` WHERE  (  ( LOWER(`modResource`.`longtitle`) LIKE '%gemeente woerkum%' OR LOWER(`modResource`.`longtitle`) LIKE '%onze%' OR LOWER(`modResource`.`longtitle`) LIKE '%diensten%' )  AND  ( `modResource`.`id` != 3 AND `modResource`.`context_key` IN ('web') )  AND `modResource`.`id` NOT IN (0) AND `modResource`.`parent` IN (16,30) AND `modResource`.`published` = 1 )  ORDER BY createdon desc LIMIT 125 <br/><strong>TV Query</strong>:<br />SELECT modTemplateVarResource.id AS tvid, Resource.id, `value`, `name`, Resource.menutitle AS menutitle, Resource.longtitle AS longtitle, Resource.introtext AS introtext FROM `modx_site_tmplvar_contentvalues` AS `modTemplateVarResource` JOIN `modx_site_tmplvars` `TemplateVar` ON `modTemplateVarResource`.`tmplvarid` =  `TemplateVar`.`id` JOIN `modx_site_content` `Resource` ON `modTemplateVarResource`.`contentid` =  `Resource`.`id` WHERE  (  ( `modTemplateVarResource`.`contentid` != 3 AND `Resource`.`context_key` IN ('web') AND `Resource`.`id` NOT IN (0) AND `Resource`.`parent` IN ('16','30') AND `Resource`.`published` = '1' AND `TemplateVar`.`name` IN ('tags') )  AND (LOWER(value) LIKE '%gemeente woerkum%' OR LOWER(value) LIKE '%onze%' OR LOWER(value) LIKE '%diensten%') )  ORDER BY createdon desc LIMIT 125 <br/><strong>Config:</strong>array(28) {
                        ["base_bath"]=>
                        string(54) "/home/searchbv/public_html/core/components/getrelated/"
                        ["core_path"]=>
                        string(54) "/home/searchbv/public_html/core/components/getrelated/"
                        ["model_path"]=>
                        string(60) "/home/searchbv/public_html/core/components/getrelated/model/"
                        ["elements_path"]=>
                        string(63) "/home/searchbv/public_html/core/components/getrelated/elements/"
                        ["resource"]=>
                        string(7) "current"
                        ["fields"]=>
                        string(21) "tv.tags:1,longtitle:2"
                        ["returnFields"]=>
                        array(3) {
                          [0]=>
                          string(9) "menutitle"
                          [1]=>
                          string(9) "longtitle"
                          [2]=>
                          string(9) "introtext"
                        }
                        ["returnTVs"]=>
                        array(0) {
                        }
                        ["parents"]=>
                        array(2) {
                          [0]=>
                          string(2) "16"
                          [1]=>
                          string(2) "30"
                        }
                        ["parentsDepth"]=>
                        int(10)
                        ["contexts"]=>
                        array(1) {
                          [0]=>
                          string(3) "web"
                        }
                        ["includeUnpublished"]=>
                        string(0) ""
                        ["includeHidden"]=>
                        bool(true)
                        ["exclude"]=>
                        array(1) {
                          [0]=>
                          string(0) ""
                        }
                        ["limit"]=>
                        string(1) "1"
                        ["fieldSample"]=>
                        int(125)
                        ["fieldSort"]=>
                        string(9) "createdon"
                        ["fieldSortDir"]=>
                        string(4) "desc"
                        ["tvSample"]=>
                        int(125)
                        ["tvSort"]=>
                        string(9) "createdon"
                        ["tvSortDir"]=>
                        string(4) "desc"
                        ["tplOuter"]=>
                        string(24) "tRelatedCasesOuterWidget"
                        ["tplRow"]=>
                        string(19) "tRelatedCasesWidget"
                        ["noResults"]=>
                        string(23) "Geen gerelateerde cases"
                        ["toPlaceholder"]=>
                        string(0) ""
                        ["rowSeparator"]=>
                        string(1) "
                      "
                        ["defaultWeight"]=>
                        int(5)
                        ["debug"]=>
                        string(1) "1"
                      }
                      <br/><strong>Fields:</strong>array(1) {
                        [0]=>
                        string(9) "longtitle"
                      }
                      <br/><strong>TVs:</strong>array(1) {
                        [0]=>
                        string(4) "tags"
                      }
                      <br/><strong>Match Data:</strong>array(3) {
                        [0]=>
                        string(16) "gemeente woerkum"
                        [1]=>
                        string(4) "onze"
                        [2]=>
                        string(8) "diensten"
                      }
                      <br/><strong>All Related Resources:</strong>array(0) {
                      }


                      When I remove the &parents property the plugin is working but I don't want other resources to be found as the ones in that particular container.