Installing Last Updated provides a Last Updated block and two dashboard pages: one page for the global settings and one providing built-in documentation for the date/time formats provided. The Last Updated block can be found in the Basic blocks section of the block add slide-out.
Following installation, you probably want to add a Last Updated block to a test page and experiment with the available settings to explore the possibilities available and decide how you would like to present the Last Updated time.
Having experimented and now knowing what your typical settings will be, you can go to the dashboard page at Last Updated > Global Settings and configure the default settings for the Last Updated block. These are the settings that will be used by default each time you add a Last Updated block to a page, so setting things up in the dashboard now can save you a lot of time editing blocks later.
When you next add a Last Updated block to a page, the global settings you saved in the dashboard will be used as default settings for the new block.
If you want to add Last Updated to all pages on your site, you can do any of:
Adding blocks individually can still be controlled globally because, when you add a Last Updated block, one of the options is to simply use the Global Settings, so allowing many blocks to be configured centrally from the dashboard, or to adapt settings specific to an individual Last Updated block.
There is no restriction on the number of Last Updated blocks you can add to a page or the formats they display. You could even have separately configured Last Updated blocks for each areas of a page.
The edit dialog is similar between blocks and the global settings. The main difference is that blocks include a checkbox to simply follow the global settings.
In the dashboard global settings, all non-global page areas used on any page through the site are listed for selection. On individual Last Updated blocks, only page areas in use on that page are available. Simply check the areas you want Last Updated to consider.
Here you can set the colour, size, position and decoration of the Last Updated time display, or leave any of these as the default from your theme. You can also add classes provided by your theme.
The message text can be edited using %s as a placeholder for the last updated time. You may need to add or remove phrases such as "ago" from the end depending on what Date/Time Format you select.
You can select between multiple date/time formats, some with friendly or human ways of expressing time and some more precise and formal. Selection uses a full-page dialog overlay to provide additional details on the date/time formatting plugins available. Simply click the (i) icon by any description for details and examples. Once selected, some of these date/time formats provide additional options.
The Refresh Examples button can be used to see how some examples evaluate with your message text and advanced settings.
In the advanced options, the main things to decide are how stacks are considered when determining the Last Updated time, whether the Last Updated block itself should be included and whether to use the server time or the visitors time zone in the calculation. For example, yesterday will be different for a visitor who resides in a different time zone to the server.
A similar checkbox configures Last Updated to look at the dates of comments within a conversation block (not shown on screenshot).
For third party blocks that have complex updated behaviours, block developers can provide the method jtf_getLastUpdated() and a further checkbox here enables Last Updated to check for that method in all blocks (not shown in screenshot). See 'Developer API' below for implementation details.
For simplicity, the message text input on the Display tab is stripped of any html tags. If you need the added flexibility of embedding html tags in the message, you can select that some tags are allowed. The tags allowed when this is checked are: strong, em, span, b, and i tags, with class and style attributes.
The Last Updated block can be safely cached, but any update made within the concrete5 core cache refresh time (by default 6 hours) will be stuck for the cache duration. You probably don’t want a Last Updated block to show Just Now for the next 6 hours, so you can use the slider on the Advanced tab of to set a minimum time ago.
The Last Updated block does not get cached by default. If you want to use it with block or full page caching, the Advanced tab also provides options to enable block caching. These settings are a convenient interface to the core block edit menu Advanced option to configure caching for a block.
If you need support, links are helpfully provided in the Support tab. When opening a support request, it can help me a lot if you use the Export Settings button to copy the block settings in JSON format and paste these settings into the support request.
The adjacent Import Settings button allows you to paste previously exported settings into Last Updated. You can use this to copy block settings between sites.
If you don't want all your site editors to have access to this part of the edit dialog, an option at the bottom of the page allows you to hide it from all but the Super Admin user and only show to the Super Admin in the dashboard page.
Most third party blocks do not need any special considerations. Last Updated can use the concrete5 core timestamp for when a block was last updated.
However, in some cases the Last Updated time of a block is more complex, such as considering the content of a stack or the comments in a conversation. Last Updated already provides options and processing for these special cases.
If you need to integrate a block of your own or a third party block with its own special case for the last updated time, you can add a method to the block controller jtf_getLastUpdated(). This should return a SQL timestamp formatted date/time for when the block was last updated. An option in the Advanced tab configures Last Updated to check for blocks providing this method.