Right now, the [layout] shortcode essentially echos out the layout because LayoutBuilder\Output::render() echos it. This isn't a big problem on pages that only use a layout and nothing else, but it causes problems for pages that mix one or more layouts and other content.
Proposed fix:
Add an $echo = true parameter to LayoutBuilder\Output::render(). This will maintain backwards compatibility, and if it's set to false, it should return the output.
Change the [layout] shortcode to use $echo = false when calling LayoutBuilder\Output::render(). This should fix the shortcode without breaking any existing code.
Right now, the
[layout]
shortcode essentially echos out the layout becauseLayoutBuilder\Output::render()
echos it. This isn't a big problem on pages that only use a layout and nothing else, but it causes problems for pages that mix one or more layouts and other content.Proposed fix:
$echo = true
parameter toLayoutBuilder\Output::render()
. This will maintain backwards compatibility, and if it's set to false, it should return the output.[layout]
shortcode to use$echo = false
when callingLayoutBuilder\Output::render()
. This should fix the shortcode without breaking any existing code.