-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Any way to ditch fluid? #184
Comments
Hi |
As I said above I think all it would take would be an event/hook in the The best approach I think would be a PHP based view. Especially if you have access to //Edit: removed an unfinished sentence at the end. |
@bernhardberger your comment sounds unfinished? |
I'm also interested in removing Fluid from JSON rendering process. If you need any help, please hit me up. |
Wouldnt the way to go be introducing custom ViewResolverInterface implementation? |
Most likely - yes. I'm hesitating to post anything because I'm I've linked the cvc_twig extension as they actually provide a very clean implementation of a custom templating engine. They however also don't have a way around existing Extbase extension ActionControllers and you'd still need to overwrite $defaultTemplateViewObject on existing controllers. And whilst I absolutely love Fluid (Imho it's one of the best and cleanest templating engines out there and I can't wait for fluid v3) - I think it's overkill and a massive pain when dealing with plain JSON output, and way too error prone, especially when you need to do loops. That all being said: I'm looking for a clean, core near implementation possibility, I don't want to hack something together that's half-assed and potentially breaks in every new core version.. Seeing that the internal structure of resolving the view in extbase changed quite a bit from 9.5 to 10 I'm hesitant to submit a PR/post a PoC without checking why it has changed and where to road leads to beforehand.. PPS: I also don't want to sacrifice on rendering FLUIDTEMPLATE partials from the PHP based view as there certainly ARE usecases where fluid comes in handy.. |
@bernhardberger did you have time to play with the ViewResolverInterface approach? |
I think we can come back to this issue and check if it's possible in v11 via DI, as we are close to release of version v3.0.0 for TYPO3 v11, so maybe we can ditch fluid anyway, as we don't have to keep compatibility with v9 and v10. |
resolves: #184 Feature if enabled replaces rendering templates in fluid in frontend context with php templates in order to simplify output json. Templates paths resolving is the same as in fluid, feature seeks just files with php extension, In php template you should just echo json_encode([...]); How to enable: - add new `headless.overrideFluidTemplates` flag to LocalConfiguration - add to typoscript settings for desired plugin, flag `phpTemplate`=1 in order to override fluid templates
resolves: #184 Feature if enabled replaces rendering templates in fluid in frontend context with php templates in order to simplify output json. Templates paths resolving is the same as in fluid, feature seeks just files with php extension, In php template you should just echo json_encode([...]); How to enable: - add new `headless.overrideFluidTemplates` flag to LocalConfiguration - add to typoscript settings for desired plugin, flag `phpTemplate`=1 in order to override fluid templates
resolves: #184 Feature if enabled replaces rendering templates in fluid in frontend context with php templates in order to simplify output json. Templates paths resolving is the same as in fluid, feature seeks just files with php extension, In php template you should just echo json_encode([...]); How to enable: - add new `headless.overrideFluidTemplates` flag to LocalConfiguration - add to typoscript settings for desired plugin, flag `phpTemplate`=1 in order to override fluid templates
Looking at the templates and actually currently working on something (very) similar to EXT:headless regarding content json rendering..
Any ideas on how to get rid of fluid? It's a massive pain in the butt and so extremely error prone when needing to write nested JSON structure..
Extbase actually would offer the possibility to use a php based view, but it's impossible to XCLASS the
ActionController
and theresolveViewObject()
method doesn't provide a hook/event to extend/alter the algorithm. All it would need would be a way to inject another php namespace for path resolving..Could be:
@overrideVendorName/@overrideExtensionName/View/@originalVendorName/@originalExtensionName/@controller/@action
.This would actually be useful in TYPO3 in general, not just in context of EXT:headless
The text was updated successfully, but these errors were encountered: