We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5112
    • 38 Posts
    i am looking at the chunk that is included in the default install called ’nl_sidebar’. 
    <strong><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></strong><br />
    [+longtitle+]<br /><br />

    i have added
    [+date+]
    to the chunk.  how can i change the formatting of this date to be like ’Saturday, June 12th’?

    thanks.
      • 7231
      • 4,205 Posts
      &dateSource=`` and the &dateFormat=`` parameters control the [+date+] placeholder. To change the format use the pgp strftime syntax to define the format: http://br.php.net/strftime

      &dateFormat=`%A, %B %eth`


      Not sure how to get the ’th, i just hard coded it above but their may be a better way.
        [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]
        • 5112
        • 38 Posts
        thanks dev_cw.

        i did come across the strftime syntax, but i am totally new to php so i did not know how to include it.

        if my current chunk code is
        <strong>[+date+]<br/><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></strong><br />
        [+longtitle+]<br /><br />
        where exactly would i insert what you propose?

        thanks again.
          • 5112
          • 38 Posts
          just launch my first site! love it.

          now if i could figure out how to correctly merge strftime and
           [+date+]
          life would be grand.
            • 1343 ☆ A M B ☆
            • 2,213 Posts
            You add it to the ditto call not the placeholder.

            AMDbuilder
              Patrick | Server Wrangler
              About Me: Website | Tweets |  MODX Hosting