Preprocessing of Entity Plus entities is confusing. One would logically assume that the following preprocess hook would work: template_preprocess_paragraphs_item() to preprocess paragraph items. But no. These preprocessing functions never get called. Which is what led people to use #theme_wrappers (to force that hook to run, but caused other issues). This also led a previous PR to use paragraphs_preprocess() to add the modal classes. Instead, you must use hook_preprocess_entity_plus and use if statements to check that you are preprocessing the right template/entity.
This relates to #91 - specifically see my comment https://github.com/backdrop-contrib/paragraphs/issues/91#issuecomment-986095491
Preprocessing of Entity Plus entities is confusing. One would logically assume that the following preprocess hook would work:
template_preprocess_paragraphs_item()
to preprocess paragraph items. But no. These preprocessing functions never get called. Which is what led people to use #theme_wrappers (to force that hook to run, but caused other issues). This also led a previous PR to useparagraphs_preprocess()
to add the modal classes. Instead, you must use hook_preprocess_entity_plus and use if statements to check that you are preprocessing the right template/entity.I will submit a PR in a minute.
IMPORTANT. For the PR to work you must: