We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2177
    • 7 Posts
    I have Ditto v.2.0.2 doing almost everything perfect...with one hiccup.

    The situation is this:
    Running MODx v 0.9.6.1B

    There is an article page that also shows an archive, or listing, of all the published articles in a sidebar. The article with the most recent published on date shows up as desired (title, date, content). But, a previous article is showing up with (title, date of most recent article, content).

    The correct dates are showing up in the sidebar, but not in the actual main article section.

    See example here: http://www.ayudaconsulting.com/test-article-3
    Notice "Test Article 3" shows up with the correct publish date of "January 11, 2008" in the sidebar, but pulls the date from the most recent article for the main content.

    Here’s what I have going on:
    {{ArticleArchiveTemplate}} Template Variable shows archive listing in sidebar
    <h2 class="article_archive"><a href="[+alias+]" title="[+title+]">[+title+]</a></h2>
        <div class="date">[+date+]</div>


    {{ArticleTemplate}} Template Variable shows article as main content
    <h1>[*pagetitle*]</h1>
        <p class="article_meta">[+date+] <em>by Mary Mitchell</em></p>
        <p>[*content*]</p>


    And the calls from the page template for the Article pages
    [b]Sidebar archive listing call
    [[Ditto? &tpl=`ArticleArchiveTemplate` &parents=`4`&display=`all` &dateSource=`pub_date` &sortBy=`pub_date` &dateFormat=`%B %d, %Y`]]


    [b]Main article call
    [[Ditto? &tpl=`ArticleTemplate` &parents=`4`&display=`1` &sortBy=`pub_date` &dateSource=`pub_date` &dateFormat=`%B %d, %Y` ]]


    I’ve done a few days of searching and can’t seem to find the thing that’s causing the issue.

    Please advise or let me know if there is more clarification needed.
      • 4310
      • 2,310 Posts
      I’ve just looked and on first page view the wrong date was being displayed.
      When I refreshed or moved to another page and then back, the correct date was displayed!
      A caching issue?
        • 2177
        • 7 Posts
        Really? I’ve tested on a few different machines and browsers, and have had no luck. Which makes me feel like it wouldn’t be a caching issue. I just tried turning off caching on the individual article pages, but it hasn’t changed for me. Or, is there something I’m missing on the caching issue?

        Just to clarify, you are seeing a date of January 11, 2008 for the Test Article 3 (in the main content area)?
          • 4310
          • 2,310 Posts
          Now that’s strange it’s now wrong.
          Either I’m seeing things now or I was before.
          Sorry, you may have to wait for a Ditto Guru.
            • 36592
            • 970 Posts
            How about using uncached form ([!...!]) to call Ditto snippet ?
              • 2177
              • 7 Posts
              Quote from: tkfm at Jan 28, 2008, 08:15 PM

              How about using uncached form ([!...!]) to call Ditto snippet ?

              Good call. I tried it...but no dice. It still shows up incorrectly.
                • 10449
                • 956 Posts
                Is there a value for pub_date at all stored in the database?
                I found that the createdon field is more reliable (or custom TVs, but that’s another story).

                Open up phpMyAdmin and check the table site_content: field "pub_date".
                In most of my docs, this is just set to 0.

                In other words, only if you really set the publish-date manually for each item you actually end up with a unix timestamp to work with.
                I only ever use it if I prepare a document now, and want it published later. Stuff like holiday announcements, welcoming new team members, new product launches etc.

                If you don’t want to change a lot of publish-dates manually for each document, you can just change your Ditto call to select the createdon field for date-source.
                  • 2177
                  • 7 Posts
                  Quote from: ganeshXL at Jan 28, 2008, 10:49 PM

                  Is there a value for pub_date at all stored in the database?
                  Yup. Values are set for all documents.

                  Quote from: ganeshXL at Jan 28, 2008, 10:49 PM

                  If you don’t want to change a lot of publish-dates manually for each document, you can just change your Ditto call to select the createdon field for date-source.
                  There’s only one ’live’ article right now - so setting lots of dates isn’t an issue.The publish date is being used to give custom date display, rather than createdon date display. This is how the client wants it - and really, it doesn’t seem like it should be a problem, so I’d like to get it figured out (if possible).
                  My fallback will obviously be to create a new TV, but since there is something built-in that should be able to handle what I want, why re-create it?
                    • 10449
                    • 956 Posts
                    Alright, just wanted to make sure.

                    What happens if you add &debug=`true` to your Ditto call?
                    You could also temp. add a [+pub_date+] placeholder in one of your templates, see if it really always gets pulled from the DB.
                      • 36592
                      • 970 Posts
                      Quote from: ganeshXL at Jan 28, 2008, 10:49 PM

                      I found that the createdon field is more reliable (or custom TVs, but that’s another story).
                      As Mark stated here, Ditto automatically use ’createdon’ when ’pub_date’ is blank.