We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11316
    • 81 Posts
    cant seem to figure out. I am sure someone can help me.

    Here is my ditto call: [!Ditto? &parents=`63` &tpl=`tpl_ClientNews` &sortBy=`pub_date` &sortDir=`DESC` &summarize=`4` &total=`50` &paginate=`1`!]

    tpl_ClientNews - formatting issue:
    <div class="cnews">
    <div class="cnewsDate"><p>[+pub_date+]</p></div> (This Displays seconds and cant figure out how to make it display properly Such as. %b %d, %Y)
    <div class="cnewsContent">[+content+]<a href="[+clientnews-links+]" target="_blank">View News Article Here</a></div>
    </div>

    Users are using the Publish date in as the setup.

    thanks in advance.
      • 1122
      • 209 Posts
      Add to your ditto call the following parameter: &dateFormat=`%b %d, %Y`
        • 11316
        • 81 Posts
        tried that didnt work - just spits out 012151000- something to do with using pub_date throws it off. any other suggestions?

        note I am not using +date+ - which did work but that’s related to creation date not the published on date.
          • 7231
          • 4,205 Posts
          change [+pub_date+] to [+date+] and then add &dateSource=`pub_date` to your Ditto call. and don’t forget &dateFormat=`%b %d, %Y` from the previous reply.

          Or use PHx to format the [+pub_date+] placehoder directly in the TPL chunk [+pub_date:date=`%b %d, %Y`+]
          http://wiki.modxcms.com/index.php/PHx#date.28.3D.60dateformat.60.29

          **PHx is available within Ditto, you do not need to install the PHx plugin
            [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

            Something is happening here, but you don&#39;t know what it is.
            Do you, Mr. Jones? - [bob dylan]
            • 11316
            • 81 Posts
            wonderful! it all worked perfectly! thank you all again for the help. It also helped me update my RSS feed to that page using the same parameters. Completely delighted!

            In case anyone needs this - using the publish date for users to change the dates and display them properly.

            Template Ditto Call:
            [!Ditto? &parents=`63` &tpl=`tpl_ClientNews` &sortBy=`pub_date` &sortDir=`DESC` &dateSource=`pub_date` &dateFormat=`%b %d, %Y` &summarize=`4` &total=`50` &paginate=`1`!]

            tpl:
            <div class="cnews">
            <div class="cnewsDate"><p>[+date+]</p></div>
            <div class="cnewsContent">[+content+]<a href="[+clientnews-links+]" target="_blank">View News Article Here</a></div>
            </div>

            Bonus - RSS Call using an xml document:(matching the rss to the view).
            [!Ditto? &parents=`63` &format=`rss` &summarize=`20` &sortBy=`pub_date` &dateSource=`pub_date` &total=`20` &tpl=`rss_chk`!]
              • 1561
              • 22 Posts
              Quote from: dev_cw at Jun 19, 2009, 01:42 PM

              change [+pub_date+] to [+date+] and then add &dateSource=`pub_date` to your Ditto call. and don’t forget &dateFormat=`%b %d, %Y` from the previous reply.

              Amazingly working. Thank you so much Shane
                An aspiring web designer & front-end web developer who is very much interested on the modern web.

                www.andrewabogado.com
                • 18817 ☆ A M B ☆
                • 205 Posts
                I’m encountering this same issue now. Usually doesn’t happen but I’ve made the changes as suggested with no luck.

                Ditto Call
                [[Ditto? &tpl=`NewsHomeDisplay` &dateFormat=`%m/%d/%y` &dateSource=`pub_date` &parents=`64` &display=`3`  &sortBy=`pub_date` &archiveDateType=`pub_date`]]


                tpl Chunk
                <p>[+date+]<br />
                [+homeIntro+]...<a href="/[~[+id+]~]" title="Read More about [+longtitle+]">read more</a></p>


                In the resource (page) I manually set the the publish date to 01-08-2008 (dd-mm-yyyy) yet it still displays as the ACTUAL published date of 12/11/09
                  Sal Baldovinos
                  SEO & DIGITAL MARKETING

                  ARIEL DIGITAL | Maximize Your Potential
                  www.arieldigitalmarketing.com
                  • 18817 ☆ A M B ☆
                  • 205 Posts
                  Interestingly enough, I just added a new article with a manual Publish Date (in page settings) and it displayed correctly. Thoughts?
                    Sal Baldovinos
                    SEO & DIGITAL MARKETING

                    ARIEL DIGITAL | Maximize Your Potential
                    www.arieldigitalmarketing.com
                    • 18817 ☆ A M B ☆
                    • 205 Posts
                    Quote from: sharkbait at Jan 12, 2010, 03:24 PM

                    &dateFormat=`%m/%d/%y`

                    shouldn’t that be without slashes?

                    The ’/’ is just my separator for the dates - ie 12/12/12
                      Sal Baldovinos
                      SEO & DIGITAL MARKETING

                      ARIEL DIGITAL | Maximize Your Potential
                      www.arieldigitalmarketing.com
                      • 16278
                      • 928 Posts
                      Might this be the same ManagerManager issue as http://modxcms.com/forums/index.php/topic,43678.msg260619.html#msg260619?
                      smiley KP