How would you implement short messages with expiration dates?

A site I’m working on requires short messages to be displayed and then go away after an expiration date. I’m interested to hear how you guys would approach this. I can think of a few options:

  • Create each message as a child resource in a container. Resources already have built-in publish and unpublish dates, but having to create a new resource for each short message could be overkill. After a while the old messages would pile up and need to be manually deleted.
  • Use MIGX to create the messages along with an associated expiration date which I can then check for in a snippet. Old messages would still need to be manually cleaned up.
  • Use Client Config to do the same as MIGX.
  • Build a custom model with the features I need and a CMP to manage it. This is a good bit more work but probably the nicest overall user experience.

Are there other options I haven’t thought of? How would you approach it?

If you use MIGXdb for the CMP, then it can be implemented quite fast.

You could periodically run a snippet with a cronjob, that deletes the expired messages.

1 Like

I created something similar using the ContentBlocks Repeater Field and some date inputs to control the publish/unpublish state. Sometimes they reuse old entries, so the client removes them when necessary.

1 Like

Thank you both! I’ll consider this.