We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6048
    • 27 Posts
    Hey !

    I started to fill my site by actual data thinking of future deploy, but ...

    Before today i had only 1 article in news. Then i added one more, news broke - instead of summary it shows newest aricle in full, either called by friendly URL or by number !

    Isn’t it creeping apart with bugs ? I won’t risk company income, my salary and entire job with such a buggy code, damn me all gods if i do !
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      My mother was very fond of collecting proverbs and sayings. One of her favorites was "You catch more flies with honey than with vinegar".
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 6726
        • 7,075 Posts
        ... or you could at least sugar coat it wink

        Unless it’s humour to the nth degree smiley
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          The point here being, if you run into a problem and want help, you’ll get it if you explain your problem in a clear manner and maybe even use the Magic Word. Ranting like my Cuban ex-husband will only get the same reaction he got (and he is, you’ll note, my EX-husband, for a reason.).

          Now, I presume you have a News page with the NewsListing snippet called. You also have a document acting as a folder to hold your individual news items (possibly the same document as your News page), and you called the NewsListing snippet with the ID of the folder/document that you are using to contain your individual news items.

          Did you also specify the string to use in your individual news documents as the trucating point? If not, by default it is <!-- splitter --> and this comment needs to appear where you want the split to occur in each individual news document. If you don’t want to use a part of the content of the news document as the summary, instead you are planning to use the document’s Summary field, add the &truncSplit=`false` option to the snippet call.

          I think you will find that configuring the snippet properly with the correct options will solve your problems.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 6048
            • 27 Posts
            Quote from: sottwell at Nov 22, 2005, 03:19 AM

            "You catch more flies with honey than with vinegar"

            Sorry if i was too crude, but i do it for living, and imagine what my boss can say on such a breakage in the middle of hot-season advertising campain !

            But anyway, how may i fix it, just for curiosity ?

            Since i’d rather revert to plain files generated from XML by hand-written script ;(
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              It’s all in the arguments you pass as options when you call the snippet.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 6048
                • 27 Posts
                Quote from: sottwell at Nov 22, 2005, 03:56 AM

                It’s all in the arguments you pass as options when you call the snippet.

                Oops it was my stupidity gem - i forgot the summary, sorry !
                BUT: letting user make such stupid error is a bug too - not the coding bug but design and usability one. I think, wider behavior is telling to user what he must split long text.

                2nd issue:
                I fail to sort news ! I did it in Manager (by ’menuID’), but in NewsListing they go in order of entry ! And should i backdate my system clock for every of few dozen news ?
                  • 6048
                  • 27 Posts
                  Quote from: cryptomancer at Nov 22, 2005, 04:13 AM

                  I fail to sort news ! I did it in Manager (by ’menuID’), but in NewsListing they go in order of entry ! And should i backdate my system clock for every of few dozen news ?

                  I attempted to set publication date - calendar not works for me, date adjusting arrows make no response !

                  I tryed to hack the date in PHPmyAdmin - it is ’int(20)’ (UNIXTIME ?) and how can i generate the proper value ?
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    As far as sorting your news display goes, the sql query is on line 125 of the snippet itself. You could easily modify that to anything you like. The createdon field is the value being used to for the ORDER BY value in the final query. Change that to anything you want, such as menuindex, and the DESC to ASC if you want. I always get those mixed up as to which one goes in which direction (if I say left I probably mean right, which really makes for some interesting results when I’m floating divs in a css file rolleyes ); fortunately there’s only two options, so trial-and-error isn’t so bad.

                    I’ve often thought it wouldn’t be so difficult to add another option argument to take care of that.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 6048
                      • 27 Posts
                      Quote from: sottwell at Nov 22, 2005, 04:44 AM

                      As far as sorting your news display goes, the sql query is on line 125 of the snippet itself.  You could easily modify that to anything you like.  The createdon field is the value being used to for the ORDER BY value in the final query.

                      Line 125 of ’NewsLister’ snippet exactly is:

                      $output = '';
                          // initialize the blog variable


                      Nothing realted to SQL query, at all. Also, this snippet completely lacks any ’order’ word.

                      I found ’SELECT’ at lines 211 and 216, and sewed the following to their tails:

                      ."' ORDER BY 'menuindex' DESC";


                      No matter how i change ASC to DESC and back, my news remain in entry order ;( (’menuindex’ is different, i did verify).

                      P.S. IMHO the info about content ordering pertains to content itself too, and once set in Manager should be retained across all and any front-end routines. Lack of such a behavior is definitely a design flaw - i found no field like ’sort_by’, or does it exist anyway ?