We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19858
    • 15 Posts
    Quote from: TDRWH at Feb 27, 2007, 01:53 PM

    My goal is to be able to format the m-d-Y and I think I can do that in version 2.0.

    Add the parameters [tt]&dateFormat=`%d.%m.%y, %H:%M`[/tt] with your formatting string. That should do what you want.
    Wow! Thanks TDRWH! Adding the parameter &dateFormat=`%d.%m.%y, %H:%M` worked like a charm and I’m using Ditto 1.0.2. Thank you!
      • 17329
      • 53 Posts
      I have a use case where I want to select documents of a folder based on a TV that is a date. My goal is to select documents that have their TV between the current date and the current date + y days and to get the x closest ones from the current date (upcoming events).

      So far I did it by passing a custom filter and by sorting by that same variable
      &filter=`EventDate,0,date` &dateSource=`EventDate` &sortBy=`EventDate`

      and by hacking ditto filter to support that filter with a 0 value

      if ($this->filterValue == ’0’) {
      // special handling for current date
      $min = time() - (24 * 60 * 60); // - 1 day
      $max = time() + (60 * 24 * 60 * 60); // + 3 month
      } else {
      // regular

      I was wondering if, with the new Ditto 2.0, I could handle it properly without messing up with Ditto code.
      And Mark already tipped me off that it is indeed possible with the extenders.

      I just need to get some more detail on the way I could do it.
      Thanks

      lionel
        • 29400
        • 15 Posts
        Hi Mark and thanks for your reply,

        Quote from: Mark at Feb 27, 2007, 02:01 PM

        &extenders=`dateFilter` is for use in conjunction with Reflect, not for formatting dates.
        I still don’t look through all that, but somedays...
        By the way, which list of parameters is up to date, i.e. for v2.0?

        http://mirror3.cvsdude.com/trac/ditto/codebase/wiki/Parameters
        http://modxcms.com/ditto_parameters.html

        ... $_lang[’date_format’] and $_lang[’more_text’] ... If no parameter is specified those are fallbacks, not configuration parameters.

        I’ve translated the language file for Ditto into German. Using that file I’ve noticed the "read more" link and the date format still to be English. Are [tt]$_lang[’date_format’][/tt] and [tt]$_lang[’more_text’][/tt] from foreign language files ignored?

        I will look into paginateSplitterCharacter...

        Maybe I’m wrong here, too. I think paginateSplitterCharacter configures the character used to separate the page links within the [+pages+] placeholder when pagination is used, right? It doesn’t show up here.

        As for the [! vs [[ call issue, that is a MODx parser limitation and has nothing to do with Ditto. MODx 0.9.7 will address this when it becomes available.

        I’ve read somewhere I should use uncached snippet calls with Ditto. I don’t know if I really need to do this as all my pages are uncached.

        Any ideas how to get the tags feature (as in the MODx example pages) back? As mentioned, the &tagData thing doesn’t work.

        TDRWH
          • 22563
          • 63 Posts
          DITTO2 RC2 AND JOT Comments problem:

          Hi,

          my call:
          [[Ditto? &tpl=`DittoTemplate` &parents=`52` &summarize=`8` &extenders=`date,summary` &showPublishedOnly=`1` &trunc=`1` &truncSplit=`1` &paginate=`1` &paginateAlwaysShowLinks=`1` &removeChunk=`Comments`]]


          "Splitted" documents work fine! The comments get removed in summary/blog view and show up if viewing the document directly (read on).

          The problems cause documents with no splitter in them!
          If viewing these ducuments directly the comments get removed, too!

          ?
            • 14050
            • 788 Posts
            Mark,

            I am just starting to explore the new ditto and was wondering if the new templating system allows for what we talked about here:

            http://modxcms.com/forums/index.php/topic,9165.msg63807.html#msg63807

            or is that what you refer to in you "notes.txt?" for a future todo:

            In the next release:
            Finish PHx truncate extension
            Conditional Templating
            Optimize getKeywords
            Allow config to load extenders
              Jesse R.
              Consider trying something new and extraordinary.
              Illinois Wine

              Have you considered donating to MODx lately?
              Donate now. Every contribution helps.
              • 18397
              • 3,250 Posts
              @jester: Conditional Templating is what is talked about in that thread and it is not yet complete in RC2. It may or may not be finished in time for Ditto 2’s final release.


              @padexx: "If viewing these ducuments directly the comments get removed, too!" If you mean going to that specific document’s page and seeing no comments, Ditto can’t have anything to do with that. It removes the comments at runtime, only when it is displaying them. Are you sure you have a Jot call or commments chunk visible on that page?


              @TDRWH: Still looking into things.
                • 1511
                • 144 Posts
                Would this be the right place to drop the language file?

                Slovenian. (sl_SI)

                If updates needed, contact me.
                  • 1511
                  • 144 Posts
                  Just as a thought... for every snippet dealing with locale strings (month names, day names, well mostly strings concerning the dates) should have a &locale parameter.

                  Currently I’m modifying all such snippets adding
                  setlocale(LC_ALL, 'sl_SI');
                  on top of them.
                    • 18397
                    • 3,250 Posts
                    For those brave enough, there is a new version in the trunk with the following changes:


                    [2007-2-28: REVISION 0000]
                    [CHANGED] Build URL now trims ID before building the URL string
                    [NEW] Debug View
                    [CHANGED] English language file for new debug view
                    [CHANGED] Reflect passes months by numbers not by name, should make multi-language compatible
                    [CHANGED] Date filter is now its own custom filter as originally planned
                    [NEW] Filters can now specify data sources they need (including multiple sources via a comma delimited list)
                    [REMOVED] $debug reference in Reflect
                    [NEW] Custom Filters can now add hidden Fields

                    [2007-3-1: REVISION 0000]
                    [CHANGED] Minor bug-fixes to debug system
                    [CHANGED] Debug templates moved out of language file into new debug templates php file like formats
                    [CHANGED] Language file now properly formatted

                    This should address this: http://modxcms.com/forums/index.php/topic,12204.msg83364.html#msg83364 with the dateFilter example

                    Also, the new debug mode is more powerful and detailed than ever before. Check out the screencap provided by heliotrope in the attachments. Also, can anyone speak to the security of the method I’m using to send the debug output to the visitor?

                    Enjoy

                    (Here is a link to the HEAD download if needed: https://svn3.cvsdude.com/wsvn/ditto/wsvn/codebase/trunk//?op=dl&rev=0&isdir=1)
                      • 22563
                      • 63 Posts
                      Thanks for the update!
                      Ditto can’t have anything to do with that.
                      You were right. It was cache related rolleyes

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