This EE2 extension demonstrates how to use Assets’s new assets_meta_add_row
hook. It adds an “Expiry Date” metadata field to file HUDs.
- ExpressionEngine 2.1.3 or later
- Assets 1.1 or later
- Upload the assets_expiry_date folder to system/expressionengine/third_party/
- Enable Assets Expiry Date in Add-Ons → Extensions
Upon installation, each of your files’ HUDs will get a new “Expiry Date” field.
You can access a file’s expiry date from Assets’ primary tag pair via the {expiry_date}
variable tag, which accepts the same format=
parameter as any other date variable tag in EE.
You can also filter your Assets fields to only show files which haven’t expired by adding expiry_date=">{current_time}"
to your opening Assets field tag.