We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20014
    • 200 Posts
    ok, I am sure you all are getting sick of this, but I am rebuilding my site on my local server on revo

    anyway this problem is almost humorous, but I checked ditto and so far the template works for posts under the container, but the date for my calender next to the post is dec 31 1969 laugh

    here is the tpl chunk:

    <div class="ditnewscontainer" id="ditnewscontainer">
    <div class="calender" id="calender">
                <div class="month" id="month">[[+createdon:date=`%b`:ucase]]</div>
                <div class="day" id="day">[[+createdon:date=`%d`]]</div>
                <div class="year" id="year">[[+createdon:date=`%Y`]]</div>
              </div>
    <div id="ditpost">
       <h2 class="head2"><a href="[[~[[+id]] ]]" title="[[+title]]">[[+title]]</a></h2>
       <div class="ditto_info" >By <strong>[[+author]]</strong>. </div>
    <div class="ditto_tags">Tags: [[+tagLinks]]</div>
     <span class="summary"> [[+summary]]</span>
      <span class="ditto_link" id="ditto_link">[[+link]]</span>
    </div>
    </div>


    and here is the call:
    [[Ditto? &parents=`8` &display=`3` &removeChunk=`Comments` &tpl=`myditto` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags` &truncAt=`</span>`]]
    
    Showing [[+start]] - [[+stop]] of [[+total]] Articles
    [[+previous]] [[+pages]] [[+next]]
    
    
    [[Reflect? &config=`wordpress` &dittoSnippetParameters=`parents:8` &id=`` &getDocuments=`1`]]


    Any ideas on how to correct the date? ps the published on date is correct in the page settings
      • 3749
      • 24,544 Posts
      I think in Revo, you need the strtotime modifier in the mix:

      [[+createdon:strtotime:date=`%Y`]]


      BTW, while you’re going to all this trouble, you really should try getResources. Ditto is deprecated in Revolution and the parameters are mostly the same.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 20014
        • 200 Posts
        thanks bob, I didn’t know about it being deprecated I simply used the revo PM to get ditto, will try.

        I tried the code and it fixed the year, can’t use it with day or month, the day and month remain dec 31st. off to to try get resources.
          • 20014
          • 200 Posts
          did a simple test of getresources here’s

          the myditto (still called it ditto) tpl
          <div class="ditnewscontainer" id="ditnewscontainer">
          <div class="calender" id="calender">
                      <div class="month" id="month">[[+publishedon:strtotime:date=`%b`]]</div>
                      <div class="day" id="day">[[+publishedon:strtotime:date=`%d`]]</div>
                      <div class="year" id="year">[[+createdon:strtotime:date=`%Y`]]</div>
                    </div>
          <div id="ditpost">
             <h2 class="head2"><a href="[[~[[+id]]]]" title="[[+pagetitle]]">[[+pagetitle]]</a></h2>
             <div class="ditto_info" >By <strong>[[+createdby:userinfo=`username`]]</strong>. </div>
           <span class="summary">[[+introtext]]</span>
            <span class="ditto_link" id="ditto_link"><a href="[[~[[+id]]]]"><span>Read more</span></a></span>
          </div>
          </div>


          and the call:
          [[!getResources? &parents=`8` &limit=`3` &tpl=`myditto`]]

          and tried this call as well used with getpage:
          [[!getPage? &element=`getResources` &parents=`8` &depth=`2` &limit=`10` &pageVarKey=`page` &includeContent=`1` &tpl=`myditto`]]


          nothing appears in the parent resource where the snippet is located. have read the docs here: http://rtfm.modx.com/display/ADDON/getResources

          think I will stick with ditto right now, but I can’t fix the date, the year was solved by bob, but when using the strtotime with the b and d parameters, nothing appeared or the month was changed to a numerical value, in my case, a 57.

          EDIT THIS IS WEIRD, I TRIED WHAT BOB HAD SUGGESTED, AND IT WORKED, BUT ONLY AFTER REMOVING THE UCASE ON THE DATE,
            <div class="month" id="month">[[+createdon:strtotime:date=`%b`]]</div>
                      <div class="day" id="day">[[+createdon:strtotime:date=`%d`]]</div>
                      <div class="year" id="year">[[+createdon:strtotime:date=`%Y`]]</div>

          WITHOUT THE UCASE, IT PLAYS NICE AND DITTO IS WORKING JUST FINE. THANKS BOB!
            • 3749
            • 24,544 Posts
            UCASE is only for strings. It wouldn’t know what to do with a Unix timestamp (and it’s unnecessary if you use the correct date format codes).

            Glad you got it working.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting