Specifically, the included component is not rendered inline, but before (above) the output of the hst:messagesReplace tag.
Please see Woonsan's comment below for an explanation, the fix and a temporary workaround:
The reason why the <@hst.include /> result is shown above the result of <@hst:messagesReplace /> tag is because the former unnecessarily flushes response output while executing:
- org.hippoecm.hst.tag.HstIncludeTag.doEndTag() -> org.hippoecm.hst.core.component.HstResponse.flushChildContent(String) -> org.hippoecm.hst.core.component.HstResponseState.flush(Writer) -> ...
Anyway, a fix for this might take a longer time than expected in most cases (because we have to make sure everything works without any problem by a fix).
For your project for now, I would use "var" attribute to fix the problem:
<@hst.include var="bannerContent" ref="banner">
<span>Bla bla bla</span>
<span>More bla bla</span>