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.

"@[handle]" convention collides with Handlebars' special "@partial-block"

See original GitHub issue

From Handlebars’ docs:

[Block] syntax may also be used to pass templates to the partial, which can be executed by the specially named partial, @partial-block.

It seems that inside of Fractal, that doesn’t work…I’m assuming that’s because Fractal’s sucking up any partials with a name prefixed by @.

This isn’t a show-stopper—you can accomplish the same thing with “inline partials”—but I figure it should at least be documented, especially since the @[handles] stuff can’t be turned off (as the rest of the handlebars helpers can).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dkhuntrodscommented, Aug 14, 2017

Hi @nategreen, this error seems to be due to a change in how handlebars handles @partial-blocks, which now makes the if trick unnecessary. I’ve corrected the error in my own templates using the block syntax which they describe in their docs - along the lines of

{{#>@partial-block}}
fallback content
{{/@partial-block}}
1reaction
dkhuntrodscommented, Mar 21, 2017

@nategreen I’ve successfully used @partial-block within Fractal, but there’s a small caveat. I wrote about it here: https://clearleft.com/posts/417 - see Container Components.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Partials
Handlebars allows for template reuse through partials. ... which can be executed by the specially named partial, @partial-block .
Read more >
Handlebars Dynamic Partial Block
handlebars . This helper is called getPartialForTemplate . This is fine, but when I need to use the resolved template as a block...
Read more >
Handlebars syntax
Typographical Conventions. Item, Description. {{ }}, Handlebars double-braces will URL encode characters that are able to be URL encoded.
Read more >
The hidden power of Handlebars partials
I was recently working on a small project with only a handful of static pages. Because it was small, we started without a...
Read more >
14 Handlebars training: Partials - YouTube
In the last video of my Handlebars training course, we explore the last topic - Partial Templates - or partials as they're commonly...
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