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

    I am very busy with implementing migx. I like it a lot. Looking really good.

    I have a question about setting an unpublish_date on a db record. Is there a way possible to set an db input on unpublished, activated by a date.

    Hope to hear from you guys soon.

    Greetings,

    Kevin Klein
      • 4172
      • 5,888 Posts
      not sure to understand what you are asking.

      Are you talking about a MIGXdb-CMP, where you want to set a unpublish_date in the editor-form-window?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 44718
        • 10 Posts
        Ah i am sorry.

        I want to set an unpublish_date to an item. So when the date is yesterday, the item is set unpublished.

        [{"MIGX_id":"1","caption":"Announcement","print_before_tabs":"0","fields":[{"MIGX_id":"1","field":"announce_name","caption":"Titel","description":"","description_is_code":"0","inputTV":"","inputTVtype":"","configs":"","sourceFrom":"config","sources":"[]","inputOptionValues":"","default":""},{"MIGX_id":"2","field":"message","caption":"Message","description":"","description_is_code":"0","inputTV":"","inputTVtype":"textarea","configs":"","sourceFrom":"config","sources":"[]","inputOptionValues":"","default":""},{"MIGX_id":"3","field":"published","caption":"Published","description":"","description_is_code":"0","inputTV":"","inputTVtype":"listbox","configs":"","sourceFrom":"config","sources":"[]","inputOptionValues":"no==0||yes==1","default":""},{"MIGX_id":"4","field":"unpublish_date","caption":"Zichtbaar tot","description":"","description_is_code":"0","inputTV":"","inputTVtype":"date","configs":"","sourceFrom":"config","sources":"[]","inputOptionValues":"","default":""}]}]


        [{"MIGX_id":"1","header":"ID","dataIndex":"id","width":"","sortable":"false","show_in_grid":"0","renderer":"","clickaction":"","selectorconfig":"","renderoptions":"[]"},{"MIGX_id":"2","header":"Titel","dataIndex":"announce_name","width":"","sortable":"false","show_in_grid":"1","renderer":"","clickaction":"","selectorconfig":"","renderoptions":"[]"},{"MIGX_id":"3","header":"Bericht","dataIndex":"message","width":"","sortable":"false","show_in_grid":"1","renderer":"","clickaction":"","selectorconfig":"","renderoptions":"[]"},{"MIGX_id":"4","header":"Published","dataIndex":"published","width":"","sortable":"false","show_in_grid":"1","renderer":"this.renderSwitchStatusOptions","clickaction":"switchOption","selectorconfig":"","renderoptions":"[{\"MIGX_id\":\"1\",\"name\":\"unpublish\",\"value\":\"1\",\"clickaction\":\"\",\"handler\":\"\",\"image\":\"assets/components/migx/style/images/tick.png\"},{\"MIGX_id\":\"2\",\"name\":\"publish\",\"value\":\"0\",\"clickaction\":\"\",\"handler\":\"\",\"image\":\"assets/components/migx/style/images/cross.png\"}]"},{"MIGX_id":"5","header":"Zichtbaar tot","dataIndex":"unpublish_date","width":"","sortable":"false","show_in_grid":"1","renderer":"","clickaction":"","selectorconfig":"","renderoptions":"[]"}]


        This is the CMP i made. Now i have added an unpublish_date. But i want to fin a way so i can check somewhere if the date is expired and then set the announcement unpublished automatic.

        I hope you understand me now.
          • 4172
          • 5,888 Posts
          If this is for a MIGX-TV, you can filter the getImageList-call with

          [[!getImageList?
          &tvname=`yourMigxTv`
          &tpl=``
          &where=`{"unpublish_date:<":"[[!today]]"}`
          ]]


          snippet today:

          return strftime('%Y-%m-%d 00:00:00');
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 44718
            • 10 Posts
            Thank you so much Bruno for the fast reply. This worked and it looks so great!