arndtteunissen / column-layout

Adds column configuration to fluid styled content elements
GNU General Public License v2.0
1 stars 2 forks source link

Use stdWrap.postUserFunc instead of ViewHelpers #9

Open jdoubleu opened 6 years ago

jdoubleu commented 6 years ago

We are providing the RowWrap and ColumnWrap ViewHelpers to render additional grid system's html around each content element. An integrator who wants to use this extension has to update the page rendering and the content element rendering by injecting these view helpers. The integrator may also use them wrong and e.g. put additional html code between the row and the column which might break the grid system. If the column wrap view helper was used several times inside one content element it might also break the grid system. Even worse: it breaks the html but the user doesn't notice because the browser corrects it.

For an out of the box solution I'd suggest to use the stdWrap.postUserFunc option in the content element rendering definition/configuration.

The FLUIDTEMPLATE content object has a stdWrap property. For fluid_styled_content based rendering the function has to be added under lib.contentElement.stdWrap.postUserFunc.

This function would then handle the row and column rendering. It is called for each content element.

Please note, that the content element is already rendered before the row and column html are wrapped around it. If the content element needs to have the column context, a DataProcessor should be used.

What do you think @codemonkey1988 ?

codemonkey1988 commented 6 years ago

Sounds like an improvement when when we can pull this out. It should stay easy to adapt changes to it.