We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    I’ve noticed that when I create and save a document, the Publish date (as found in the "Page Settings") is never filled.

    What’s the point of a Publish date field if its not used?

    How do you make it auto-update when the document is saved, or is it reliant upon a Document status field (ie: Publish, Draft, Private, etc)?

    Thanks.
      • 15082
      • 195 Posts
      The publish and unpuplish dates are there for autmated (un)publishing at the given date/time.

      Greetz
      JUSI
        • 32645
        • 377 Posts
        How do you make the Publish date pick up the date on save?
          • 15082
          • 195 Posts
          I don’t know if this is possible.
          It’s intended to be set manually to a date/time in the future to be published then.

          Greetz
          JUSI
            • 4041
            • 788 Posts
            If you click on the calendar icon in the publish input field, and then click the highlighted day on the calendar (it should be the current date and will show the time at the bottom by default) it will populate the publish field.
              xforum
              http://frsbuilders.net (under construction) forum for evolution
              • 36416
              • 589 Posts
              Quote from: worchyld at Oct 15, 2009, 09:29 AM

              How do you make the Publish date pick up the date on save?

              One way is by using ManagerManager,
              function mm_default("pub_date")
                • 20413
                • 2,877 Posts
                ManagerManager let you set pub_date as default value

                mm_default($field, $value, $roles, $templates, $eval)

                Provides a default value for specific fields in new documents / folders.

                Another SUPER awesome plugin -> http://modxcms.com/forums/index.php/topic,36558

                // LOL grin
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                  • 32645
                  • 377 Posts
                  I installed ManagerManager, and I tested the mm_rules.inc.php to rename the introtext to "Summary of article" -- this works fine.

                  However, when I do:

                  // From the ManagerManager documentation;
                  mm_default('pub_date'); // Always set the publish date on new documents to the current date and time
                  


                  The published date field is never filled with any date at all, even when I save it.

                  How do I get the published date to display the date inside the text box?
                    • 36416
                    • 589 Posts
                    Quote from: worchyld at Oct 19, 2009, 05:27 AM

                    The published date field is never filled with any date at all, even when I save it.
                    How do I get the published date to display the date inside the text box?

                    Try it with role specified:
                    mm_default("pub_date", "", "!1"); // only for non-admins
                    


                    It works here...
                      • 27708 MODX Staff
                      • 2,502 Posts
                      IIRC there is a separate publishedon field (in the db) that is non-settable that actually takes the date on which a document is set to published. It is not the same as pub_date which is to be used for delayed automatic publishing of documents.

                      In any event it is cool that you can accomplish this using ManagerManager. This could prove to be very useful.
                        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub