Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Feature/rendering rework #16

Closed
wants to merge 30 commits into from
Closed

Conversation

jdoubleu
Copy link

@jdoubleu jdoubleu commented Sep 2, 2018

Do not merge until WIP status resolved!

When merged, it resolves #8

Changes of this PR will not be backwards compatible!

TODOs:

  • Update Documentation
  • Use ViewHelperVariableContainer for grid state (see Store grid rendering state in ViewHelperVariableContainer #15)
  • Decide whether to use the default template resolving behavior (templatePaths, layoutPaths, ..) of fluid (see 1bc3d32#diff-8e2b4d42d99503bb77d3d8b16c03ef2bR3) or to use the file option in FLUIDTEMPLATE.
    • Improve code re-usability (prevent DRY) in grid system templates. Yet the Column and RowEnd sections are the same for all 3 grid systems, only RowBegin changed. However they are included in each template file. Maybe extract them into partials?
  • Move (complex) rendering logic from view helpers..
    • ... either into a render class which also acts like a state machine
    • ... into a custom implemented Fluid view
  • Implement custom Fluid RenderingContext to store the grid rendering state/context.
  • Merge RowXXX sections into a single section. This section will contain the row opening and closing html as well as the content. The content will be injected via a RenderableClosure for lazy and cachable rendering of the inner content.
    • To extract the row opening and closing tags, a custom rendering implementation must be implented. This might be possible by rendering the row section with no content and...
      • ... throwing a StopCompilingException to get the row opening tags
      • ... later subtracting the row opening tags from the whole (empty) content row to get the row closing tags
  • Validate and analyze caching of the grid systems
  • Provide more options to integrate the grid system
    • Through stdWrap.postUserFunc of main rendering in PAGE (see Use stdWrap.postUserFunc instead of ViewHelpers #9)
    • Through ViewHelpers (as it works right now)
    • Through TypoScript by providing lib. functions
    • Through a custom content object (e.g. FLUIDGRID) which extends the FLUIDTEMPLATE object. This would smoothly work with a custom template view as explained above. \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject::initializeStandaloneViewInstance can simply be overwritten to instantiate the custom view.

@jdoubleu jdoubleu added the enhancement New feature or request label Sep 2, 2018
Joshua Westerheide added 26 commits September 3, 2018 14:38
Add missing CompileWithContentArgumentAndRenderStatic trait to ViewHelper class.
Move renderStatic method to AbstractGridViewHelper and implement only specific rendering in each grid ViewHelper.
The $contentArgumentName property was not properly set for the CompileWithContentArgumentAndRenderStatic. This caused the compile ViewHelper to use the first argument (which is not the content!) to be used as content.

Regression of 063193f.
Integrate this service into the current grid ViewHelpers. Remove unused code from the ViewHelpers and update TypoScript as well as the default grid system templates.
Remove all unnecessary code from AbstractGridViewHelper.
The whole content records was wrongly assigned to this variable in 4ebbce6.
The grid template's row and column html now fully wraps its content. The template service provides methods to render only the row opening or closing html.
Implement new rendering logic in renderer class. The column rendering method now renders also the row opening and closing html before its content. This moved the state logic from the grid templates into the renderer class.

Move render check from view helpers into renderer class.
The row should never be rendered as whole element but its opening or closing html can.
See the class' phpDoc for more information.
These ViewHelpers have to be used when defining the grid system rendering. The TemplateViewHelper will auto-generate two sections which will be compiled into the grid system template for the opening and closing row.
This ViewHelper should only render its content in the best performant way.
This ViewHelper is only required for the row content. Furthermore it is only used as a marker/placeholder. Therefore renamed the ViewHelper to better fit its purpose.

Also update its usage and the default grid systems templates.
The compiled code must not be action terminated!
They will now be rendered the original way (of this PR):
1. The row section is rendered with a special marker (injected by the RowContentViewHelper).
2. The rendered HTML is then splitted (explode()) at the marker.
3. Both parts are saved to the cache and the requested rendered part is returned.

This change requires an additional identifier parameter passed to the row parts rendering methods.
The parsing based row split, which compiled dynamic section on-parsing-time, does not work for nested ViewHelpers or partials.

This commit squashes two revert commits:
1. Revert "Implement fluid template parser interceptor to emit PostParseEvent". This reverts commit 83e8134.
2. Revert "Implement templating ViewHelpers for grid templates". This reverts commit e61c639.
Its already injected through the GridRenderer.
@jdoubleu jdoubleu closed this Mar 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant