We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20477
    • 25 Posts
    EDIT - scratch that, that wasn’t the problem at all and it’s still broken. Will try PHx

    sad I am sooo stupid.

    I had the wrong placeholder in the blogTemplate file all this time.

    Please feel free to call me an idiot...

    Thanks for all your help.

      • 20477
      • 25 Posts
      Here’s the situation. I have created a TV called showdate, which uses Unixtime.

      The template used to display is called blogtemplate:

      <div class="entry">
      <h2><a  href="[~[+id+]~]">
      	[+title+]</a>
      </h2> 
      <p>[+showdate+]</p>
      <p>[+summary+]<br />
      <a  href="[~[+id+]~]" class="morelink">
      	More...
      </a></p>
      <p class="stamp">By <strong>[+author+]</strong>
      on [+date+].</p>
      </div>


      The ditto call is:

      [!Ditto? &startID=`17` &summarize=`10` &total=`20` &extenders=`summary` &tpl=`BlogTemplate` &sortBy=`showdate` &dateSource=`showdate` &dateFormat=`%d/%m/%y` &sortDir=`ASC`!]



      But the date is not actually formatted. I hope I’ve given enough information for someone to be able to help now. The last time I thought it was fixed it was actually sorting by the date that the item was published, not the TV showdate, which is the date that the concert is taking place on.

      HELP!!!
        • 36592
        • 970 Posts
        The placeholder [+showdate+] is not formatted in human readable form.
        I said you can format it with PHx plungin. But I personally do not want to use it, so I don’t know how to do it.

        But [+date+] placeholder is the human readable form of TV showdate.
        And the format is specified with &dateFormat parameter.
        I can see it is working properly on your site ( http://www.localism.org.uk/modx/shows.php ).
          • 4310
          • 2,310 Posts
          As I understand it:
           &dateSource=`showdate`


          This sets the source of [+date+]

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


          This is formatting [+date+]

          That’s why your [+showdate+] is unformatted and showing as Unixtime
            • 20477
            • 25 Posts
            I see, it makes perfect sense now and I have fixed it.

            Does that mean you couldn’t have two dates showing? For example, as I originally tried to do, the date the item was posted, and the date of the actual show?
              • 4310
              • 2,310 Posts
              A quick workaround is to use one of the other standard document TV’s.
              You could use the description field for another date, as text.
              Then use [+description+] in your Ditto template wherever you want to show the second date.
              Also if you want to have the events drop off the Shows page when they’re finished add this to your Ditto call
              &filter=`showdate,@EVAL return time();,3`