What's good about Expiry is that this stack uses server side code (PHP) to regulate whether content is shown or hidden. This decision making happens on the web server, before the webpage gets sent down to the web browser for display. Therefore a website user can't "fiddle" their clock settings to view content or look for it hidden in the page source code! The latter are potential weaknesses you may face with using client side Javascript to hide or display content. Expiry is very reliable, in this regard.

In the easiest configuration, you could set a single date and time, you want content hidden after. Alternatively you could setup two date ranges, and choose to have content shown or hidden outside of these dates. Should you need to, it's also possible to nest one Expiry stack inside of another!

If you need a more advanced array of date and display controls, the AdvancedPublisher set of stacks is definitely a better upgrade over Expiry. These stacks can help you do things like repeat an event daily, weekly or monthly and create more sophisticated test conditions. Expiry and AdvancedPublisher replace the former SeyDesign TimeRelease stack.

Examples

Here are some basic examples of the Expiry stack in action:

This Expiry stack was setup to display content at any time before 25th December 2022. So if you are looking at this page before this date, you should be reading this content right now!
This Expiry stack was setup to display content after 4th July 2013. So if you are looking at this page after this date, you should be reading this content right now!
Expiry supports all basic content types, including text, Markdown, HTML, images, audio and video. Almost any stack can be nested (placed within) Expiry and configured to display at a precise date and time. Expiry works great with many of the other stacks available on this website. You can safely use multiple Expiry stacks on the same page.

Setup

Usage of Expiry is very simple. Install this stack element into RapidWeaver and Stacks, in the normal way. Drag and drop a copy of Expiry from your Stacks Library into the webpage. Staying in edit mode, drag and drop the content you want "time controlled" into the Expiry stack, where is says drop stacks here. In the Stacks side panel with the Expiry stack selected, you can access all of its settings. You can adjust different aspects of Expiry like the display mode, timezone, and dates. The checkbox to display details in edit mode and colour code your Expiry stack are useful to help you maintain a tidy workspace in RapidWeaver. All the Expiry settings have informational tooltips, on mouseover.

Differences to Expiry v1

Expiry v2 is updated for RapidWeaver 8 and Stacks 4. It will install itself alongside Expiry v1 stacks. In the fullness of time, it would be wise to gradually stop using Expiry v1 and use Expiry v2 for all new projects going forwards. Expiry v2 has an all new editing interface, easier date and time selection, improvements to timezone selection and is tested for compatibility with PHP 8. Expiry v1 is available from the archive page if you still need it.
 

Contribute

If you find this stack element useful in your personal or commercial web projects; please consider making a small contribution towards ongoing support and updates. There are many different ways you can contribute to the Stacks4Stacks project, and benefits for doing so.