A hands-on learning environment for content designers to explore headless CMS concepts using Contentful.
See a working example right away: View Demo Site
This shows you what's possible with Contentful - a real GOV.UK-styled website powered by a headless CMS.
Download this project and create your own version with your own Contentful space. This is where the real learning happens!
- Content modeling (structuring content independently from design)
- Content relationships (how different content types connect)
- Preview workflow (draft β preview β publish)
- API basics (how content is delivered to websites)
- Separation of content and presentation
- A web browser (Chrome, Firefox, Safari, or Edge)
- A free Contentful account (for building your own)
- No coding knowledge required!
- Go to contentful.com
- Click "Start building for free"
- Sign up with your email or GitHub
- When prompted, select "Create an empty space"
- Name your space (e.g., "My Learning Project")
-
In Contentful, go to Content model in the top navigation
-
Click Add content type
-
Fill in:
- Name: Organisation
- API Identifier: organisation (leave as default)
-
Click Create
-
Add these fields by clicking Add field:
Field 1: Name
- Type: Text (Short text)
- Check "Required field"
Field 2: Acronym
- Type: Text (Short text)
- Help text: "e.g., HMRC, DWP, DVLA"
Field 3: Description
- Type: Text (Long text)
- Help text: "What this organisation does"
Field 4: Website URL
- Type: Text (Short text)
- Help text: "Link to the organisation's main website"
Field 5: Slug
- Type: Text (Short text)
- Check "Required field"
- Help text: "URL-friendly identifier"
-
Click Save at the top right
-
Go back to Content model
-
Click Add content type
-
Fill in:
- Name: Service Page
- API Identifier: servicePage (leave as default)
-
Click Create
-
Add these fields:
Field 1: Title
- Type: Text (Short text)
- Check "Required field"
Field 2: Summary
- Type: Text (Long text)
- Help text: "Brief overview of the service (2-3 sentences)"
Field 3: Body Content
- Type: Rich text
- Check "Required field"
Field 4: Start Button URL
- Type: Text (Short text)
- Help text: "Link to start the service"
Field 5: Organisation
- Type: Reference (One reference)
- Under "Accept only specified entry type", select Organisation
Field 6: Last Updated
- Type: Date and time
Field 7: Slug
- Type: Text (Short text)
- Check "Required field"
- Help text: "URL-friendly version of the title"
-
Click Save
- Go to Content in the top navigation
- Click Add entry β Organisation
- Fill in:
- Name: Department for Transport
- Acronym: DfT
- Description: We work with our agencies and partners to support the transport network that helps the UK's businesses and gets people and goods travelling around the country.
- Website URL: https://www.gov.uk/government/organisations/department-for-transport
- Slug: department-for-transport
- Click Publish (green button, top right)
- Go to Content β Add entry β Service Page
- Fill in:
- Title: Apply for a provisional driving licence
- Summary: You need a provisional driving licence to take lessons or practice before taking your driving test.
- Body Content: (Use the rich text editor to add):
You must be at least 15 years and 9 months old to apply for a provisional driving licence. What you need to apply: - An address in Great Britain - A valid UK passport or other form of ID - Your National Insurance number (if you know it) It costs Β£34 to apply online or Β£43 to apply by post. - Start Button URL: https://www.gov.uk/apply-first-provisional-driving-licence
- Organisation: Click and select "Department for Transport"
- Last Updated: Select today's date
- Slug: apply-provisional-driving-licence
- Click Publish
- In Contentful, go to Settings (top navigation) β API keys
- Click Add API key
- Give it a name like "Learning Project - Website"
- You'll see these important values - copy them:
- Space ID
- Content Delivery API - access token
- Content Preview API - access token
- Open the
index.htmlfile in a text editor (Notepad, TextEdit, or VS Code) - Find these lines near the top of the
<script>section:const SPACE_ID = 'YOUR_SPACE_ID_HERE'; const DELIVERY_TOKEN = 'YOUR_DELIVERY_TOKEN_HERE'; const PREVIEW_TOKEN = 'YOUR_PREVIEW_TOKEN_HERE';
- Replace the placeholder text with your actual API keys from Step 4
- Save the file
- Double-click
index.htmlto open it in your web browser - You should see your service page displayed with GOV.UK styling!
- Try checking the Preview Mode checkbox to toggle between published and draft content
- Edit content in Contentful - Make changes to your service page
- Save as draft (don't publish yet)
- Check "Preview Mode" in your website - You'll see your unpublished changes
- When happy, publish in Contentful
- Uncheck "Preview Mode" - You'll see the live published version
Goal: Understand the edit β preview β publish workflow
- In Contentful, edit your Service Page
- Change the title to something different
- Save (don't publish)
- In your website, check "Preview Mode" - see your change
- Publish in Contentful
- Uncheck "Preview Mode" - see the published version
Goal: Learn how rich text works in a headless CMS
- Edit the Body Content field of your Service Page
- Add a new heading using the formatting toolbar
- Add a bulleted list
- Make some text bold
- Preview and publish
Goal: Understand content relationships
- Create a new Organisation (e.g., DVLA, HMRC, Home Office)
- Create a new Service Page
- Link it to your new organisation
- Publish both
- Refresh your website to see it
Goal: Understand draft vs. published content
- Create a new Service Page but DON'T publish it
- With Preview Mode OFF, refresh your website - you won't see it
- With Preview Mode ON, refresh - now you'll see it
- This shows the difference between draft and live content
- Check that you've published at least one Service Page in Contentful
- Verify your API keys are correct in
index.html - Make sure your Space ID is correct
- Check the browser console (F12) for detailed errors
- Make sure you've clicked Publish in Contentful (not just Save)
- Refresh your browser (F5)
- If using Preview Mode, make sure the checkbox matches what you want to see
- You must have at least one Service Page created AND published
- Check the content type API identifier is exactly "servicePage" (case-sensitive)
Once you're comfortable with the basics, try:
- Create more content types (Guide, News Article, Contact Information)
- Create multiple service pages and add navigation
- Experiment with media - add images to your organisations
- Learn about localization - create content in multiple languages
- Check the troubleshooting section above
- Review the Contentful documentation
- Ask your team lead or instructor