Sanity Pioneers: Get early access to betas, extra AI credits, and a direct line to the engineering team. Apply now

Missing displayExcerpt and displayTitle fields on Sanity front page

14 repliesLast updated: Nov 29, 2025

I got to the post page title and excerpt working in the post page, but i am missing the "displayExcerpt" and "displayTitle" on the front page. A little unsure what I'm missing, I swapped "titles" and "excerpt" for "hero. post" and "more.articels" to "displayTitle" and "displayExcerpt". What am I doing wrong?

AI Update

It sounds like you're working on a front page where you're trying to display post titles and excerpts, but the data isn't showing up. Based on your description, this is likely a GROQ query projection issue where the field names in your query don't match what you're using in your component.

The Problem: When you query for posts on your front page, you need to make sure your GROQ projection uses the same field names (displayTitle and displayExcerpt) that your front-end component is expecting.

Common mistakes:

The fix:

Your GROQ query for the front page should look something like this:

*[_type == "post"]{
  "displayTitle": title,
  "displayExcerpt": excerpt
}

The "displayTitle": title syntax creates an alias - it takes the title field from your schema and renames it to displayTitle in the query results. This is how projections work in GROQ - you can select specific fields and rename them to match what your frontend expects.

If you're working with a starter template (like the Next.js blog starter), the original queries might have used different field names. Make sure:

The query is likely in a file like lib/queries.ts, sanity/lib/queries.ts, or directly in your page component. Double-check that both your front page query and your post page query use the same field naming - if the post page is working, copy that projection structure to your front page query and it should work consistently.

Show original thread
14 replies

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions