docs: place template-override settings inside preUserFunc.#845
Conversation
There was a problem hiding this comment.
Code Review
This pull request corrects the TypoScript configuration examples and documentation for overriding image rendering templates, clarifying that the settings block must reside inside preUserFunc. (or externalBlocks.figure.stdWrap.preUserFunc for captioned images) because TYPO3 only forwards preUserFunc. to the rendering callable. The review feedback suggests improving readability and alignment with TYPO3 conventions by nesting the settings block instead of using flat dot notation, and using the standard dot suffix (e.g., settings.) instead of an asterisk (e.g., settings.*) in comments and documentation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Addressed the Gemini review feedback in
|
befd637 to
fbff414
Compare
There was a problem hiding this comment.
Pull request overview
This PR corrects the extension’s documentation/examples for TYPO3 Fluid template overrides by moving settings.* (e.g., templateRootPaths) into the preUserFunc. sub-configuration, which is the only configuration array forwarded by TYPO3’s stdWrap_preUserFunc() to the rendering callable.
Changes:
- Update TypoScript examples to configure
settings.{template,partial,layout}RootPathsunderlib.parseFunc_RTE.tags.img.preUserFunc. - Add an explicit, correct example for figure-wrapped (captioned) images under
lib.parseFunc_RTE.externalBlocks.figure.stdWrap.preUserFunc. - Add a short explanation in all three locations describing why the nesting is required.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
Resources/AGENTS.md |
Fixes the architectural note/example so template override settings are placed under preUserFunc. and adds the figure equivalent. |
Documentation/Examples/Template-Overrides.rst |
Corrects the canonical docs example and clarifies the preUserFunc. forwarding behavior; adds an explicit figure override block. |
Configuration/TypoScript/ImageRendering/setup.typoscript |
Updates the inline comment example to show preUserFunc { settings { ... } } and notes the figure configuration location. |
|
Hi @marekskopal, thanks for the PR. |
CybotTM
left a comment
There was a problem hiding this comment.
Please sign -S your commits, everything else looks fine to me. Thank you.
The Template-Overrides example, the architecture note in
Resources/AGENTS.md, and the inline comment in
Configuration/TypoScript/ImageRendering/setup.typoscript all show the
template override as:
lib.parseFunc_RTE.tags.img {
settings.templateRootPaths.10 = EXT:my_sitepackage/...
}
That placement does not work. ContentObjectRenderer::stdWrap_preUserFunc
only forwards $conf['preUserFunc.'] (the sub-array of the preUserFunc
key) to the callable — anything placed as a sibling of preUserFunc
under tags.img is invisible to ImageRenderingService::buildTemplatePaths().
Move the example under preUserFunc.settings.* and document the same
requirement for externalBlocks.figure.stdWrap.preUserFunc (used by
renderFigure() for captioned figures).
Signed-off-by: Marek Skopal <skopal.marek@gmail.com>
Address review feedback:
- Replace `settings.*` with `settings.` (canonical TYPO3 sub-property
notation) in all prose.
- Nest the override example as `preUserFunc { settings { templateRootPaths
{ ... } } }` instead of the flat `preUserFunc.settings.templateRootPaths`,
which gets awkward at three levels deep.
Signed-off-by: Marek Skopal <skopal.marek@gmail.com>
fbff414 to
fab386f
Compare
Summary
The current template-override documentation places
settings.templateRootPathsas a sibling ofpreUserFuncunderlib.parseFunc_RTE.tags.img, e.g. (fromDocumentation/Examples/Template-Overrides.rst):That placement has no effect. TYPO3's
ContentObjectRenderer::stdWrap_preUserFunc()only forwards$conf['preUserFunc.']to the callable:So anything under
tags.img.settings.*is never seen byImageRenderingAdapter::renderImageAttributes(), and therefore never reachesImageRenderingService::buildTemplatePaths(). As written today, the documented override silently does nothing — integrators end up with the default extension templates regardless of whattemplateRootPathsthey set.The correct placement is inside
preUserFunc.:The same applies to
externalBlocks.figure.stdWrap.preUserFuncfor figure-wrapped (captioned) images, which is rendered viarenderFigure().Empirical confirmation
I hit this while overriding templates in my own site package: with
settings.*at the documentedtags.imglevel my custom templates were ignored. After moving the block intopreUserFunc.settings.*, the custom templates loaded immediately. ImageRenderingService'sbuildTemplatePaths()already handles either$config['settings.']['templateRootPaths.']or$config['templateRootPaths.']directly, so the only change needed is in the docs.Changes
Three places carried the same incorrect example; this PR fixes all three:
Documentation/Examples/Template-Overrides.rst— the canonical override example, plus the accompanying note aboutexternalBlocks.figure.stdWrap. The figure-side example is now spelled out explicitly so users don't have to guess where to put it.Resources/AGENTS.md— short architectural note that mirrored the bad example.Configuration/TypoScript/ImageRendering/setup.typoscript— inline comment block that shipped with the extension.Each fix moves
settings.*underpreUserFunc.and adds a one-line explanation of why (stdWrap_preUserFunconly forwards its own sub-array), so future readers don't have to re-trace the call.Test plan
make lint) — docs-only change, no PHP/JS edits.composer ci:test:php:unit) — docs-only change.settings.templateRootPathsunderpreUserFunc.is the placement that actually loads custom templates on a real TYPO3 v13.10 install.Related issues