We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33673
    • 14 Posts
    Hi,

    Why is the date output in lowercase? It’s not in NewsListing.

    Using example: %A, %d %B %Y

    I’d like the first letter to be uppercase on both weekday and month. Thanks.
      • 18397
      • 3,250 Posts
      What locale is your server in as it will base its output on that. (PHP thing...)

      There is no code in Ditto to change the date output to lowercase...
        • 33673
        • 14 Posts
        I put setlocale(LC_ALL, ’sv_SE.UTF-8’); at the top of the ditto snippet.

        Is there a better way to place it, like a custom php.ini or anything. I don’t know the default locale, some US since server is there.

        How can I check?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I put it in the config.inc.php file, just before the session starting code.
            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
            • 33101
            • 46 Posts
            Hello,

            I am working on my first MODx site and I see the updated versions of NewsListing and now Ditto and I am wonder if someone could tell me what the difference is? What functions does one do that the other doesn’t? Ditto is new and based on Newslisting - is it now obsolete?

            If this has already been answered somewhere, could you post the location?

            Thank you
            Yehosef
              • 25663 MODX Staff
              • 12,272 Posts
              Newslisting will no longer be developed. A fine piece of code, but it’s last year’s model. Use Ditto.
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 33453
                • 141 Posts
                Quote from: The at May 15, 2006, 03:56 PM

                For instance, if I set sortBy=`pub_date`, the archive still displays the createdon date. If I set the archiveDateType=`pub_date` it displays the correct dates, but does not categorize them by month properly

                Quote from: Mark at May 16, 2006, 02:10 PM

                @The Man Can! : The first part of what you describe is an intentional feature. The manager only sets published_on and fields like it if the value is set. By default, the values are 0. Since that messes up sorting, an inline SQL if is used to swap out createdon for published_on if published_on is not set. That way it still gets sorted instead of Ditto freaking out. For you other issue, use both sortBy=`pub_date` and archiveDateType=`pub_date` in the same call. That should fix things.

                Brett, Mark

                There is a field called "publishedon" (and also "publishedby") in the database which should be (see below) always set to the current time on publication. However this is currently not a sort option in Ditto. I have tried modding ditto.class.inc in "checkSort", "checkDateFormat", and "getDocuments" and it seems to work OK.

                However, there seems to be a bug in the manager, and the fields only get set correctly if you publish by right clicking the document. Setting the checkbox in the editor does NOT work.
                  • 18397
                  • 3,250 Posts
                  Ditto can sort by anything, even TV’s. As I said earlier, MODx does not set publishedon when saving a document unless the user expressly sets it. Therefore a complex inline SQL query swaps between publishedon and other fields like it with createdon if the value of the field is 0.
                    • 33453
                    • 141 Posts
                    Me again.

                    If sortBy or sortDir are not specified they default to "createdon" and "DESC" respectively.

                    By "Descending", I understand that the latest created article (i.e. with the highest value in the "createdon" field) would be displayed first in the list and the oldest last.

                    However, this does not happen - the list is displayed the reverse of this.

                    If I specify a sortBy of "createdon" in the snippet call then it is displayed as I expect.
                      • 19777
                      • 35 Posts
                      Hi Mark

                      I’m not sure whether the following change needs to be made (as it is very minor) for consistently rendering quotes (") versus apostrophes (’) in Ditto’s archive output. In noticed that in the english.inc.php file on the default_archive_template apostrophes were being rendered instead of quotes (like the rest of the code). So you might consider changing the line:

                      $_lang['default_archive_template'] = <a href='[~[+id+]~]'>[+title+]</a> (<span class=\"ditto_date\">[+date+]</span>)";


                      to

                      $_lang['default_archive_template'] = <a href=\"[~[+id+]~]\">[+title+]</a> (<span class=\"ditto_date\">[+date+]</span>)";


                      And maybe add a title tag by default, something like: title=\"Link to [+title+]\"

                      Like I said, a tiny change.

                      This discussion is closed to further replies. Keep calm and carry on.