“On this day” function

To go along the the random post feature, it would be cool to also have an “on this day” feature that loads a random post from the current date in the past, if any.

Or maybe let people choose between a version that does a random post from previous todays, or a version that just loads a posts list of all posts on previous todays.

1 Like

Cool, will see if I can slip this in over the weekend!

1 Like

Sat down to work on this and then realized that I have some questions:

  1. Should this be a separate page (as with the random feature), or should it be something that can be pulled in from a tag, e.g. {on-this-day}?
  2. If it’s a special page, what should happen when there aren’t any posts to show? Should there be some configurable text to display? (If it’s a tag, I would assume that the desired behavior would be to hide the output entirely, so you could have a page that some days might have “on this day…” and then other days there would simply be nothing at all.
  3. If it’s a tag, should it output links to entries or the actual entry content? Actually, I suppose it this should be templatable so it would output whatever you want…

Anyway, sorry, just thinking through some of the implementation details on this one and would love your input!

Personally, I’d be using this as a separate page, but that’s just as easily done through a {on-this-day} function, especially if it comes with something like an On this day format: configuration setting. As for handling a “false” day, maybe something like the Search results success message and Search results failure message settings?

ETA: I should say that my use case preference would be I’d likely be displaying a list of posts, rather than a single, full post, I think? So id probably do it something like my landing page, where I use my custom excerpt front matter.

1 Like

OK, sounds like the tag would be the most useful all around (since it can be put on its own page easily enough). Will work that into the next update!

1 Like