Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handlebars special partial "@partial-block" gets reported as unknown global #19930

Open
1 task done
miko007 opened this issue Mar 26, 2024 · 1 comment
Open
1 task done
Labels
bug [triage] something behaving unexpectedly

Comments

@miko007
Copy link

miko007 commented Mar 26, 2024

Issue Summary

The handlebars template engine provides an internal, special partial called @partial-block, that can be used when calling a partial in "block style".

Instead of calling the partial regularly like {{> my-partial}}, it can be called in block form like

{{#> my-partial}}
  some fallback text
{{}/my-partial}

Inside the partial, the content passed inside the block can then be accessed using the special partial {{@partial-block}}. The feature itself works like expected inside of a ghost theme, the usage gets however reported as a theme error, specifically as "{{@partial-block}} is not a known global". This should not be the case.

image

Steps to Reproduce

  1. put a partial with the content
<div>
   fancy partial
     {{#if @partial-block}}
   <article>
   	{{> @partial-block}}
   </article>
     {{/if}}
</div>

in a theme.

  1. call it like
{{#> my-partial}}
   this is a fallback text
{{/my-partial}}
  1. check backend for theme errors

Ghost Version

5.75.1

Node.js Version

18.19.0

How did you install Ghost?

docker

Database type

MySQL 5.7

Browser & OS version

No response

Relevant log / error output

No response

Code of Conduct

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Mar 26, 2024
@daniellockyer daniellockyer added the bug [triage] something behaving unexpectedly label Apr 1, 2024
@daniellockyer
Copy link
Member

Hey there, thank you so much for the detailed bug report.

That does look like something that shouldn't happen! A PR to fix this issue would be very welcome 🙂

@github-actions github-actions bot removed the needs:triage [triage] this needs to be triaged by the Ghost team label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

2 participants