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

    I can be manage to get my date format looking like my inital mockup in standard CSS:



    What I would like to try and do now is get it looking like the image above in ditto. As far as I know, you cannot style separate elements of the date. Maybe someone can tell me otherwise, and I am really hoping they will smiley Thinking about it, I could have it set up manually, but that would be a bit of a hassle.

    Hope someone can help.

    Thanks
    Lee
      http://www.blend.uk.com | Web Design by Blend
      • 18397
      • 3,250 Posts
      Get Ditto 1.1 Beta 2 and use the PHx date placeholders to parse the date. So you would do [+dateSource:date=`dateFormat`] where dateSource and dateFormat are the ditto parameter values respectively. Then you would just split up dateFormat by each space and you would have 3 placeholders. You can then wrap these in divs and style accordingly.
        • 17717
        • 433 Posts
        Thanks Mark,

        That sounds like a plan.

        Lee
          http://www.blend.uk.com | Web Design by Blend
          • 17717
          • 433 Posts
          where can i grab the beta from?

          Thanks
          Lee
            http://www.blend.uk.com | Web Design by Blend
            • 17717
            • 433 Posts
            don’t worry about the above, got it smiley
              http://www.blend.uk.com | Web Design by Blend
              • 17717
              • 433 Posts
              Hi Mark, I am having a few problems with the parameters I need to put in, is the documentation for dittos new features, or maybe some examples of what I am trying to acheive.

              Thanks.
              Lee
                http://www.blend.uk.com | Web Design by Blend
                • 11975
                • 2,542 Posts
                Hi,

                I guess you could create a phx:modifier(snippet)

                create a new snippet phx:renderDate
                
                $date = strftime($option,$output);//where option is the param passed to phx:modifie
                //output is the current value of the placeholder
                $dateElements = explode(" ",$date);
                $mydate = "<div>". dateElements[0]." <p>". dateElements[1] ."<br />". dateElements[2]."</p></div>";
                return $mydate;
                
                
                


                in your ditto Chunk

                [+createdon:renderDate=`%d %M %Y`+]

                Not tested but you have the idea.

                :-)
                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 17717
                  • 433 Posts
                  Thanks heliotrope, I will certainly try that if I can’t get Mark’s method working, he seems to think that the beta version of ditto, which I now have installed, can do the trick.

                  Here is what I have so far:

                  <strong>Latest News</strong>
                  [[Ditto? &startID=`6` &summarize=`2` &total=`2` &descendentDepth=`1` &dateSource:date=`pub_date` &dateFormat=`%a`  &total=`20` &tpl=`ditto_articles` &paginate=`1` &alwaysshow=`1`]]


                  With my ditto template looking like this:

                  <div class="ditto_summaryPost">
                  <a href="[~[+id+]~]">
                  <h4 class"ditto_heading">[+title+]</h4>
                  <div>[+summary+]</a></div>
                  <p class="readmore">[+link+]</p>
                  <div class="dottedline_x"></div>
                  </div>
                  <div class="ditto_date">[+date+]</div>


                  This display just the month exactly how I want it.

                  I don’t totally understand how to split the format up, tried to carefully follow Mark’s guide, its a little difficult for me a the minute, just trying out variations in the hope I might stumble upon the right code combo.

                  Maybe someone who know what their doing can help me out undecided

                  Thanks
                  Lee



                    http://www.blend.uk.com | Web Design by Blend
                    • 11975
                    • 2,542 Posts
                    Have a look to the snippet code to adapt your param in your ditto call.
                    Some of them have changed (beta 1.1.2) such as descendentDepth which is now &depth.

                    :-)
                      Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                      • 17717
                      • 433 Posts
                      Still not manageed to get this working, can anyone who knows ditto better than I do help me out?

                      Thanks
                      Lee
                        http://www.blend.uk.com | Web Design by Blend