DERTOUR GroupDesign
Documentation
Guide contents
03Search results section 3 of 10

Result tabs

Trip ideas / Hotels / Destinations. You own the wording, the order and which one opens first; the counts are the search's.

The entry you edit

Search results (Page)

Content type

Page


What makes it this section
Field = tabs

A JSON object on the Page entry, labelled "Search results only".

What a visitor sees

On the websiteLIVE
Three tabs — Trip ideas 10, Hotels 24, Destinations 1 — with Trip ideas open.
Trip ideas is open here because it is the tab marked as opening first.
  1. 1

    Tab label

  2. 2

    The tab that opens first

  3. 3

    The count — the search's, not yours

What each field controls

The Field column is the label as it appears in Contentful; under it, the field's id, for talking to a developer. The number matches the marker on the screenshots above.

#FieldWhat it controlsNotes

Result tabs

tabs
The tab labels, their order, and which tab opens first.

A JSON object. Either { "items": [ … ] } or a bare [ … ] — both are accepted. Each item is { "id", "label", "defaultActive" }.

— id

tabs.items[].id
required
Which set of results the tab shows.

A closed set: the page has code for these three and nothing else. Any other id makes the whole field invalid, and the page then uses its built-in three tabs.

Choose one of:
trips
hotels
destinations
1

— label

tabs.items[].label
required
The wording on the tab.

2

— defaultActive

tabs.items[].defaultActive
Which tab opens when a visitor arrives.

Optional, on one tab. Setting it settles a genuinely undecided question: the designs show Hotels opening first, the delivery note says Trip ideas, and nothing on record agrees. Whichever you set wins, with no deploy. A link that already names a tab still wins over this.

3

The count beside each label

Nothing you can set.

Marked on the screenshot because it looks authored and is not: it is how many results the search found on that tab, and it changes with every search.

How to change it, step by step

  1. Open the search results Page entry

    Search Contentful for the Page entry whose Kind is "searchResults" and open it.

  2. Open the Result tabs object editor

    This field is a JSON object, not a set of boxes. Contentful shows it as a code editor and checks nothing about what you type, so the shape below has to be exactly right.

  3. Edit the JSON, keeping the shape

    Change labels and order freely. Do not invent ids: an id the page has no code for is dropped, and the page records that it dropped it.

  4. Publish, then check the page

    Change status → Publish. If the field is malformed the page ignores it WHOLESALE and keeps its built-in copy rather than applying half of it — so a page that looks unchanged after publishing usually means a JSON error. /api/debug-fallbacks lists what fell back and why.