Content Search result customizability

Aperta
#395 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

@cr0ybot ci sta già lavorando.

Dal 16/9/2025.

  • #396 di @cr0ybot — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
frontend

Direzione di ricerca

Inizia da components/content-search/utils.ts, in particolare dalla gestione di queryFilter e normalizeResults intorno alle righe collegate, quindi segui il percorso degli elementi normalizzati fino a renderItemType di ContentSearch. Confronta lo schema della risposta dell’endpoint di ricerca con il tipo di risultato normalizzato; il lavoro è completo quando i renderer personalizzati possono accedere ai dati della risposta incorporati e i campi di risultato esistenti continuano a funzionare.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I work on a news publisher site with loads of content. We used to be able to customize the ContentSearch component's query and renderItemType in order to extract additional necessary information for content editors, particularly the publish date of a post. We did this by:

  1. Using the queryFilter prop and adding the _links and _embedded fields (_embed=true is already added by the component but without these other fields nothing is actually embedded)
  2. Utilizing the _embedded property passed to renderItemType to customize the results items to display the post date

After this normalizeResults line was added, it is now impossible to reference any properties of the response items other than id, subtype, title, type, and url, which makes renderItemType almost completely useless for our purposes.

I'm not sure what the correct answer is here, but I would love to at least be able to include the _embedded property as part of the normalized results type since that is a standard part of the search endpoint schema. It would be a nice bonus to be able to make use of custom fields added to the search results schema, but that would probably be harder to account for.

Lingua principale
TypeScript
Stelle
330
Fork
54
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di 10up/block-components

Tutte le issue di 10up/block-components

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.