You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A similar idea has been discussed elsewhere (#208), but eventually went off the rails and fizzled. I'm proposing section blocks similar to those in Laravel's Blade Template that could look something like this:
Here is a quick rundown of the 4 possible functions. Things could get much more complicated when you start nesting sections inside of other sections. This would also allow partials to easily be used inside of various layout templates and adapt according to the layout. If section doesn't exist in any of the parent templates then append, prepend, and overwrite return nothing.
{{!--block--}}{{append"name"}}
<p>Appends parent section if it exists, otherwise does nothing.</p>
{{/append}}{{!--string--}}{{append"name""string"}}
Prepend
{{!--block--}}{{prepend"name"}}
<p>Prepends parent section if it exists, otherwise does nothing.</p>
{{/prepend}}{{!--string--}}{{prepend"name""string"}}
Overwrite
{{!--block--}}{{overwrite"name"}}
<p>Overwrites parent section if it exists, otherwise does nothing.</p>
{{/overwrite}}{{!--string--}}{{overwrite"name""string"}}
The text was updated successfully, but these errors were encountered:
This requires some fairly large changes to how Handlebars renders templates due to the need to change sections of the output after it has rendered the initial time. It's not impossible but it will take a fair amount of work.
A similar idea has been discussed elsewhere (#208), but eventually went off the rails and fizzled. I'm proposing section blocks similar to those in Laravel's Blade Template that could look something like this:
Master Layout Template
Edit User Form Partial
Output
Here is a quick rundown of the 4 possible functions. Things could get much more complicated when you start nesting sections inside of other sections. This would also allow partials to easily be used inside of various layout templates and adapt according to the layout. If
section
doesn't exist in any of the parent templates thenappend
,prepend
, andoverwrite
return nothing.Section
Append
Prepend
Overwrite
The text was updated successfully, but these errors were encountered: