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
    description for the documents that had keywords selected.
      follow me on twitter: @dimmy01
      • 23050
      • 1,842 Posts
      No, I don’t remember having used description... Maybe should try again this snippet ! smiley
        • 7455
        • 2,204 Posts
        It works nice for me

        sorry that I did not answer this question before
          follow me on twitter: @dimmy01
          • 23050
          • 1,842 Posts
          Don’t worry thanks anyway wink
            • 13577
            • 302 Posts
            Quote from: StanBogdanov at Jan 07, 2008, 05:07 PM

            ...AND content.id != ORDER BY date DESC LIMIT 10; ...

            That’s a problem. What isn’t the content.id equal to? It should be pulling in the current document’s ID but doesn’t seem to be. check around line 112 of the snippet to make sure it reads:
            AND content.id != ".$modx->documentObject['id']."

            If it is fine, then there’s something weird going on. In the resource downloads, this was only specified as working through 0.9.2 - so I don’t know that much testing has been done beyond that.
              Standard Disclaimer
              I could be totally wrong.
              • 28359
              • 9 Posts
              Hi, and thanks

              I got the snippet from the repository and around those lines it reads:
               // make sql statement for retreiving similar pages
                $pre= $modx->dbConfig['dbase'].".".$modx->dbConfig['table_prefix'];

              $relatedSql = "
              SELECT DISTINCT content.id, content.pagetitle, content.description,
              IF(content.pub_date > 0, content.pub_date, content.createdon) AS date
              FROM
              ".$pre."site_content AS content,
              ".$pre."keyword_xref AS xref,
              ".$pre."site_keywords AS keywords
              WHERE keywords.keyword IN (".$keyString.")
              AND xref.keyword_id = keywords.id
              AND content.hidemenu = ".$showhidemenu."
              AND content.id = xref.content_id
              AND content.id != ".$modx->documentObject['id']."
              ORDER BY ". $sortBy . ' ' . $sortDir ."
              LIMIT ".$maxRelated.";";

              $relatives = $modx->dbQuery($relatedSql);
              $relativeCount = $modx->recordCount($relatives);
              $relArray = array();
              for($i=0;$i<$relativeCount;$i++) {
              array_push($relArray,$modx->fetchRow($relatives));
              }
              <br /><br />so it has this 112th line
              AND content.id != ".$modx->documentObject['id']."
              <br /><br />but doesn’t seem to pick it up and parse it ok.<br /><br />Indeed, the snippet says 092, suggesting it was written around that time, but there are other people using it on 0.9.6 without problems as I read this thread.<br /><br />I’ve got FURLs and alias ON, could that be the problem?<br /> As I understand, the syntax is not the correct/suitable syntax for my current MySQL version 5.0.45<br /><br />My call is the suggested minimal<br />
              [[ListRelated?LR_keywords=fun,functional,good stuff]]
              <br /><br />Thanks for any help anyone can offer.<br />
              • [[listRelated?LR_keywords=fun,functional,good stuff]] will not work... I think you need the backticks to escape the parameter value that includes a whitespace character, i.e. [[listRelated?LR_keywords=`fun,functional,good stuff`]]

                note: with uppercase L’s; not sure why the forum keeps translating those to lowercase L’s.
                  • 7455
                  • 2,204 Posts
                  if no keyword is set it will look at the keyword set in the document itself
                    follow me on twitter: @dimmy01
                    • 28359
                    • 9 Posts
                    Thanks OpenGeek

                    I’ve got the backticks now. That’s not the problem, though.

                    When I tick "Execute snippet after saving", MODx spits a Parse Error (as I wrote previously)

                    Thanks anyway

                    • Quote from: StanBogdanov at Jan 08, 2008, 11:56 PM

                      When I tick "Execute snippet after saving", MODx spits a Parse Error (as I wrote previously)
                      That feature to execute the snippet in the manager is bogus and serves no useful purpose IMHO; does it work on the front end?