backdrop-contrib / paragraphs

Paragraphs module to control your content flow
https://backdropcms.org/project/paragraphs
GNU General Public License v2.0
5 stars 11 forks source link

Extend EntityPlusController and restore/rewrite `template_preprocess_paragraphs_item` #113

Closed argiepiano closed 2 years ago

argiepiano commented 2 years ago

In recent a issue (#110) and a recent merged PR (#111) we fixed a rendering problem (#91) by eliminating a faulty #theme_wrappers in paragraphs.field_formatter.inc and by using paragraphs_preprocess_entity_plus instead of template_preprocess_paragraphs_item to preprocess variables for the template paragraphs_item.tpl.php.

However, after further discussion with @laryn we decided to, instead, create a new entity controller for Paragraphs to override buildContent in order to override the default theme for Entity Plus entities (entity_plus) and instead use the theme paragraphs_item. This will allow us to go back to use template_preprocess_paragraphs_item to preprocess variables, which makes more sense for other developers who want to extend this preprocessing with their own hook implementations in the future.

In addition to creating a new entity controller for Paragraphs, we need to rewrite template_preprocess_paragraphs_item to do all the necessary preprocessing that used to be done by template_preprocess_entity_plus.

PR coming

argiepiano commented 2 years ago

PR: #114