Referring to future content

Opinion
Mar 8, 20043 mins

* Linking to a future publication

Here’s an interesting issue that came up: When you write something that is published online and plan to follow it up, what can you do to link the current piece to the future piece? For example, “Next week we’ll continue with our discussion …” – you’d like to make “Next week” a link to the piece. The problem is, of course, that the future piece is not yet available (I know, I know, “Du’oh”).

You could go back when the piece is published and make “Next week” a link but that’s going to be pretty confusing if you publish many documents.

On the other hand you could create a dummy file with a “Coming soon” message but if there are many items being published trying to keep track of what goes where could get complicated and error prone very quickly.

I talked to a colleague who considered that he might be able to solve the problem using his Web site’s very expensive and complicated content management system. But he did conclude: “Our CMS actually understands the concept of embargoes on links … However, to use this function, the following week’s article needs to be in the database.” I suspect this is a tricky problem for most CMSes without programming.

So here is my solution, which I think is pretty simple: It requires that you have a structure for storing and naming the files such as “/category/document/date.html”. In practice, this might look like “/articles/mystuff/010304.html”.

You need to also have a list of allowed categories and a list of planned publishing dates. The planned publishing schedule might look something like this:

010304

080304

150304

240304

290304

Note that all dates are 7 days apart except for the second to last date – using a scheduling file allows for variation in your publishing routine.

Now you need to build a filter that “front-ends” each Web request to be handled by the server. Note that if publishing always occurs on the same day – there’s never a variation – then the filter could determine the publishing date programmatically.

It doesn’t actually matter where the filter sits in the flow of the request through the server as long as no other process diverts the request and generates a 404 if the “forward requested” content doesn’t yet exist.

You can write this in any language you please and what the filter needs to do is as follows:

 * Get requested URL.

 * Extract from URL the category (URLcategory) and the date (URLdate).

 * If the URLcategory is not recognized then exit.

 * If the URLdate is less than or equal to now() then exit.

 * If URLdate not in publishing schedule then exit.

 * Respond “document not yet available.”

 * Exit.

This method ensures that the original system handles 404s as it normally should and only responds to request for documents that are planned to be published. An extension to the method would be to check to see if the request for what was a future document link and should now exist in fact doesn’t – a suitable response could be generated and the sysadmin notified.

Let me know if this idea is of use to you or if you do anything like this in your own Web applications already.