We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    it should work as long as the date TV is not formatted with a Date Formatter widget...

    Alternate method to format date if you use the PHx plugin is use PHX date modifier :

    [tt][*item-date:date=`%d.%m.%Y`*][/tt]

      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l'outil id
      • 28203
      • 26 Posts
      I simply cannot get this to work. It displays nothing. I have put the code into the template and it just displays:

      By on .

      On the places where the date and author should be, there is only empty space. Anyone knows why?
        • 7923
        • 4,213 Posts
        Is the document created using newspublisher or other front end document manager?


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 28203
          • 26 Posts
          Quote from: doze at Apr 28, 2008, 10:37 AM

          Is the document created using newspublisher or other front end document manager?

          I create my documents through the MODx manager.

          How should I create them to display the author and date?
            • 7923
            • 4,213 Posts
            If the document would have been created with newspublisher snippet, it would have explained why the AuthorTimestamp was not working.. But don’t know why it’s not working for you then.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 7231
              • 4,205 Posts
              There big problem is that there is am extra /* in the top comments that are breaking the snippet entirely by making it all a comment. Remove one of the /* from the first line. Then there is no closing ?> at the end of the document, snippets need opening and closing php tags.

              That should do it. There is some old API calls but they seem to still work. For example it says $modx->dbQuery($query); but shouldn’t it be $modx->db->query($query);? I tested and both work so it may not make a difference.
                [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't know what it is.
                Do you, Mr. Jones? - [bob dylan]
                • 28203
                • 26 Posts
                I think I solved it by calling out the snippet without parameters, simply [[AuthorTime]]

                I was confused because I struggled with other plugins all day and didn’t even think about trying it out without any parameters. I was trying out some parameters as someone suggested, but I guess they were wrong or something, I’m so stupid for not trying it out as default first.

                Anyway, thanks for the response guys, I will change $modx->db->query($query); so I don’t have any future problems with it, now that you mentioned dev_cw smiley
                  • 12147
                  • 182 Posts
                  Another "Is There Any Way..." question...

                  I want to show the date that the website was updated, no matter which page. I’ve got "Last Updated: (date)" working fine for each single page, but is there some way that GetTime can show a site-wide update date (tied to any page on the site, not tied to specific pages)?

                  (I’ve tried LastUpdate, and can’t get it to present the correct date).

                  Thanks for any help with this.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    I think you’d need a custom snippet for that; it would need to query the site_content table, order by the editedon field, and grab the latest date to display.
                    return date('j F Y', $modx->db->getValue($modx->db->select('editedon', $modx->getFullTableName('site_content'), 'published=1', 'editedon DESC', 1)));
                    
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 12147
                      • 182 Posts
                      You are brilliant! It’s perfect (and no site crash, either wink )

                      Thank you so much! grin

                      Why not post this in the Repository? I’m sure I’m not the only one wanting to document site-wide updates.

                      Wendy