We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Thanks for reporting back!

    Enjoy
      Patrick | Server Wrangler
      About Me: Website | TweetsMODX Hosting
      • 21078
      • 77 Posts
      Very nice add-on! Is it also possible to combine getRelated with getPage to paginate the results?
        L.net Web Solutions
        Professional webdesign and development with MODX and WordPress.
      • Quote from: Nebulous at Jul 18, 2012, 02:46 PM
        Very nice add-on! Is it also possible to combine getRelated with getPage to paginate the results?

        No.

        I'm not sure if it's something that a lot of people would use as well - its primary goal is to show related posts, but in the end everything that contains at least one word that is used in the resource being matched to is related.. you could have 150 possibly related posts where the last 125 really aren't but contain similar words.
          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.
          • 36762
          • 45 Posts
          I'm using getRelated to match books in a series from a template variable named "series". So for example if I have Harry Potter books I put the name "Harry Potter" in the series TV.

          The problem is that if the series field is left blank on books which are not part of a series, then getRelated doesn't know what to do. Gives the message:

          "Error collecting distinctive data from the resource to match against."

          ... rather than degrading to a custom message about not being part of a series or whatever.


          If you work on a fix I would like to see a couple of things in relation to this kind of scenario.
          1. a switch to tell getRelated to treat a lack of input the same as no matches.
          2. a switch to tell getRelated to look for exact matches and ignore the stopword list. So that "A Bird Book" is distinctly different from "The Bird Book".
          [ed. note: pixelstuff last edited this post 11 years, 7 months ago.]
          • Hey Jeff,

            I've added your main request to the github repo here: https://github.com/Mark-H/getRelated/issues/11 - feel free to offer additional feedback there if you have any.

            For now (until I change the snippet behavior, which may take a while as I've got tons of stuff in higher prio right now), head over to System > Lexicon Management and change the language string "getrelated.error.nodistinctivedata" in the getrelated namespace to something else: http://markh.nl/s/q3/nvQ.png

            I've also added your ignore stopwords request to github, but I have to say I'm not 100% sold on that feature yet. The way getRelated works is that it splits up any words it can find, and finds matching stuff based on that. So it doesn't look for "The Bird Book", but it looks for "bird" and "book" (as "the" gets filtered out from the stopwords list). Skipping the stopwords list could easily result in 10 times the results, but less accuracy in there (it does limit to 125 resource matches by default tho).

            If you're looking for exact matches based on a tag, you might be looking for tagLister instead of getRelated. getRelated is meant to be a nifty little tool that automatically finds resources similar to the current one through text comparison.
              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.
              • 36762
              • 45 Posts
              Ah. TagLister is probably what I was looking for but didn't know it existed.

              Assuming I can use getResources more than once on the same page. [ed. note: pixelstuff last edited this post 11 years, 7 months ago.]
                • 36762
                • 45 Posts
                Well currently I can't tagLister to list any matching pages.
                  • 43099
                  • 38 Posts
                  Hi I am implementing getRelated now, it works great! But I do have a small problem that I hope someone could point me in the right direction on.

                  Basically, I have a div and the links and title is in there, but what I would like is to have the link results shown in two columns in the div, so that it looks more balanced and I can provide more related pages in a smaller vertical space.

                  Right now I have 5 links, but I would prefer to have 6 in two columns.

                  Any idea how to go about that? I feel a little stumped about how to do it.

                  Thanks!
                    • 38723
                    • 165 Posts
                    Quote from: d_u_n. at Jun 03, 2013, 08:35 AM
                    Hi I am implementing getRelated now, it works great! But I do have a small problem that I hope someone could point me in the right direction on.

                    Basically, I have a div and the links and title is in there, but what I would like is to have the link results shown in two columns in the div, so that it looks more balanced and I can provide more related pages in a smaller vertical space.

                    Right now I have 5 links, but I would prefer to have 6 in two columns.

                    Any idea how to go about that? I feel a little stumped about how to do it.

                    Thanks!

                    Are you using a ul inside this div or are they just a or span tags?

                    You could do it one of two different ways:

                    1) Float each item in the div left and give them almost 50% width which will stack them into columns, or
                    2) Use CSS columns syntax (doesn't work in older versions of IE though)

                      • 43099
                      • 38 Posts
                      Quote from: pdincubus at Jun 03, 2013, 04:03 PM
                      Quote from: d_u_n. at Jun 03, 2013, 08:35 AM
                      Hi I am implementing getRelated now, it works great! But I do have a small problem that I hope someone could point me in the right direction on.

                      Basically, I have a div and the links and title is in there, but what I would like is to have the link results shown in two columns in the div, so that it looks more balanced and I can provide more related pages in a smaller vertical space.

                      Right now I have 5 links, but I would prefer to have 6 in two columns.

                      Any idea how to go about that? I feel a little stumped about how to do it.

                      Thanks!

                      Are you using a ul inside this div or are they just a or span tags?

                      You could do it one of two different ways:

                      1) Float each item in the div left and give them almost 50% width which will stack them into columns, or
                      2) Use CSS columns syntax (doesn't work in older versions of IE though)


                      Hi thanks for your reply pdincubus. Yes, I am using the standard templating and using a ul with a class for styling, and then li under that, all in a div.

                      Now, the div has a specified width, I think it is 70%, but no specified height. But, if I remember my css basics, what you are saying is that by specifying a width for each element that is less than 50% of the div, then the second element will go into the second "column"

                      So, if my ul is called getrelated, then the css would look something like this, right?

                      ul.getrelated li {width:40%;}

                      So...simple?