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
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
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:
- 3533214-processor-rendereditem-add
compare
Comments
Comment #2
andreasderijckeComment #5
andreasderijckeComment #7
drunken monkeyGreat idea, makes perfect sense. Thanks for the suggestion!
Merged.
Thanks again!
Comment #8
drunken monkey