Skip to main content
Warning This document has not been updated for a while now. It may be out of date.
Last updated: 4 Feb 2022

smart-answers: Landing page template

Landing page templates live in app/flows/<flow-name>/start.erb.

Content types

The templates can contain content for any of the following keys:

:title

Used as the h1 heading and can only be text. Example:

<% text_for :title do %>
  Look up Meursing code
<% end %>

:meta_description

Used as the content for the meta description tag. Can only be text. Example:

<% text_for :meta_description do %>
  Look up the additional code (Meursing code) required for import or export of goods containing certain types of milk and sugars
<% end %>

:body

Used to generate the main content (appearing above the start button). Expected to be govspeak or HTML. Example:

<% govspeak_for :body do %>
  Use this tool to look up the additional code (Meursing code) for import or export of goods containing certain types of milk and sugars covered Regulation (EC) No. 1216/09.
<% end %>
<% html_for :body do %>
  <p>Use this tool to look up the additional code (Meursing code) for import or export of goods containing certain types of milk and sugars covered Regulation (EC) No. 1216/09.</p>
<% end %>

:post_body

Used to generate supplementary content (appearing below the start button). Expected to be govspeak or HTML. Example:

<% govspeak_for :post_body do %>
  Code of measuring practice became globally effective in May 2015.
<% end %>

Optionally, it is possible to supply a custom header for this section. If supplied, this will override the default "Before you start" heading and can only be text. Example:

<% text_for :post_body_header do %>
  Travelling to England from within the UK, Channel Islands and the Isle of Man
<% end %>