When doing a subrequest, you lose critical information like the siteaccess, or the semanticPathinfo (used by helper ezpublish.requestedUriString).
When using ESI or Hinclude strategies, it's really problematic since the default siteaccess is used then and thus the right configuration is not used and links are not generated correctly.
- Use a siteaccess that is not your default one
- Create your pagelayout.html.twig
- On this template try to dump
- Result is okay (for example i got "/" )
- Create an override (ex: welcome.html.twig)
- On this template try to dump ezpublish.requestedUriString
- Result is Okay (i got "/")
- Dump the siteaccess name ezpublish.siteaccess.name
- Create a subrequest using either Hinclude or ESI strategy on welcome.html.twig something like
- Create a template for this render and dump parameter and siteaccess name
- Result is ko (got null as answer for ezpublish.requestedUriString and my siteaccess is the default one).