question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested/Partial template support

See original GitHub issue

Does exist any Nested/Partial template feature in Scriban?

like includes in dotLiquid https://github.com/dotliquid/dotliquid/wiki/DotLiquid-for-Designers#includes https://github.com/dotliquid/dotliquid/issues/198

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
bradlis7commented, Apr 25, 2019

@xoofx Can we open this to formally request a better syntax for a layout file?

Perhaps simplify the structure of sfmskywalker’s my-content.liquid to be:

{{layout "_layout"}}
Hello World!

I haven’t seen a better way currently.

3reactions
sfmskywalkercommented, Mar 17, 2019

I was able to achieve my goal as follows:

my-content.liquid

{{ capture content }}
Hello World!
{{ end }}
{{include "_layout"}}

_layout.liquid

<html>
<body>
   {{ content }}
</body>
</html>

Which outputs:

<html>
<body>
    Hello World!
</body>
</html>

Although this approach works for me, I’m still wondering if there’s an alternative (recommended) way of doing this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is partial specialization of a nested class template ...
My guess as to why this happens: complete specializations are no longer "template classes/functions", they are are "real" classes/methods, ...
Read more >
Nested templates and partial forms
Unfortunately, Semantic Forms does not support nested templates now, so filling such a template with form is not possible.
Read more >
template for nested content
Hi. I am new to Umbraco (and to coding other than html/css, actually) and need help with a template for nested content. What...
Read more >
Nested/child HTML in a partial? - support
Hello. Is there a way to create a component-like HTML wrapper in Hugo with children? For example in React you can do <WrapperComponent> ......
Read more >
Template deduction for nested classes | P0293R0
This restriction is severe in contexts like partial specialization and conversion function templates where template arguments must be deduced.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found