Metadata block example
Display page history
This will set up an expandable section on the page, with a top border, to let users toggle the display of the page history. It also includes a hidden H2 heading of ‘Updates to this page’. This heading will not be included if one is passed to the component using the title option.
This example includes an expandable ‘part of’ section to show both toggling elements working together in one component instance.
How it looks (preview)
How to call this example
<%= render "govuk_publishing_components/components/metadata", {
part_of: [
sanitize("<a href=\"/government/world/afghanistan\">Afghanistan</a>"),
sanitize("<a href=\"/government/world/albania\">Albania</a>"),
sanitize("<a href=\"/government/world/algeria\">Algeria</a>"),
sanitize("<a href=\"/government/world/angola\">Angola</a>"),
sanitize("<a href=\"/government/world/anguilla\">Anguilla</a>"),
sanitize("<a href=\"/government/world/argentina\">Argentina</a>"),
sanitize("<a href=\"/government/world/armenia\">Armenia</a>"),
sanitize("<a href=\"/government/world/australia\">Australia</a>"),
sanitize("<a href=\"/government/world/austria\">Austria</a>"),
sanitize("<a href=\"/government/world/azerbaijan\">Azerbaijan</a>"),
sanitize("<a href=\"/government/world/bahrain\">Bahrain</a>")
],
first_published: "1st January 1990",
last_updated: "20th October 2016",
page_history: [
{
display_time: "1st January 1990",
note: "First published",
timestamp: "1990-01-01 15:42:37 +0000"
},
{
display_time: "20th July 1995",
note: "Updated to include information for 1994",
timestamp: "1995-07-20 15:42:37 +0000"
},
{
display_time: "14th October 2000",
note: "Updated information on pupil premium reviews and what information schools need to publish on their websites.",
timestamp: "2000-10-14 15:42:37 +0000"
}
]
} %>