Problem/Motivation

For the Search API Exclude - Layout Builder module, we needed a way to know when RenderedItem processor is the cause of Layout Builder components being rendered, so we can intercept and alter the Layout Builder render result.

We played around with various solutions, using existing options (dedicated role for example).
The solution we ended up with, is added a custom value to the temporary user session that is created in the RenderedItem, as it seemed least intrusive and no additional config is needed.
Additionally, it allows other modules to inspect the current user session and detected if we are rendering for indexing or not.

Proposed resolution

Add custom value 'search_api_processor' with value 'rendered_item' to the UserSession that is created to render content for indexing.

Or something similarly unique, that can be detected and acted upon by other modules.

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork search_api-3533214

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Issue fork facets-3533214

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andreasderijcke created an issue. See original summary.

andreasderijcke’s picture

Project: Facets » Search API
Version: 3.0.x-dev » 8.x-1.x-dev
Component: Code » General code

andreasderijcke changed the visibility of the branch 3533214-processor-rendereditem-add to hidden.

andreasderijcke’s picture

Assigned: andreasderijcke » Unassigned
Status: Active » Needs review

drunken monkey made their first commit to this issue’s fork.

drunken monkey’s picture

Component: General code » Plugins
Status: Needs review » Fixed

Great idea, makes perfect sense. Thanks for the suggestion!
Merged.
Thanks again!

drunken monkey’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.