Filter field in paragraphs summary

Created on 16 October 2023, about 1 year ago

Problem/Motivation

In the paragraphs summary (used for "search index" /admin/structure/types/manage/parapage/display/search_index) I can see all the texts from each paragraph. Thanks for the really good summary!

But: I had 1 field in the paragraph for functional classes (field_paragraph_classes). I want to hide this in the summary.

How to filter the field field_paragraph_classes in the summary?

I did not find any exclude or filter documentation for this. Maybe I would hook something for filter this class field?

Steps to reproduce

  • custom node type "Paragraphs Page" with a field for content (field_parapage_content) with type "Entity reference revisions"
  • Paragraphs Page view mode "Search index" (/admin/structure/types/manage/parapage/display/search_index) the field field_parapage_content in format "Paragaph summary"
  • custom paragraph type "Paragraph Text" (paragraph_text) (with 2 fields: content (field_paragraph_text formatted long) and classes (field_paragraph_classes text plain)
  • search api index (/admin/config/search/search-api/index/default_index/fields) where rendered_item for node type pargraphs Page is "Search index"
  • Not relevant: view of index search api content - show rendered entity with view mode "Search result highlighting input"

Proposed resolution

The Paragraph "Paragraph Text" has a display mode (like all the nodes).
I disabled the field field_paragraph_classes in the backend UI (/admin/structure/paragraphs_type/paragraph_text/display).
So I thought it would not being indexed.
My twig file for this field (field--field_paragraph_classes.html.twig) is with this code (so no visible HTML text would be visible). So I thought it would not being indexed.
<span class="para-classes-info" data-class="{% for item in items %}{{ item.content }}{% endfor %}"></span>

💬 Support request
Status

Active

Version

1.16

Component

Documentation

Created by

🇩🇪Germany thomaswalther Rhein-Main Area

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024