We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1637
    • 5 Posts
    Hello,

    I’m currently putting together a blog-style page using Ditto. I’ve done it before, so I’m fairly familiar with the basics, but I’ve hit a stumbling block with displaying the date. I’m aware that the [+date+] tag will output the date in a set format, but I need to insert some tags inside my date in order to style it. Basically, I need to wrap some code around the day of the month. For example, if it’s 12 September, the code would be:

    <div class="date"><div class="top">12</div>Sep</div>


    This is then obviously styled in the CSS. Is there any way to make this happen in Ditto?

    Many thanks in advance.
      • 7231
      • 4,205 Posts
      Yes. Use PHx to style the output of the date filed you are using (I could not get +date+ t work with PHx).
      <div class="date">[+editedon:date=`<div class="top">%e</div>%b`+]</div>


      More on PHx here: http://wiki.modxcms.com/index.php/PHx

        [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]
        • 1637
        • 5 Posts
        Thanks so much for this! I’d never have worked it out myself; I was messing around creating snippets calling strftime; but didn’t get any further than getting it to display 1 Jan 1970...!