# Use partial parameters in #get helper

**URL:** <https://forum.ghost.org/t/use-partial-parameters-in-get-helper/43016>\
**Category:** Themes\
**Created:** [November 29, 2023, 5:55am UTC](https://forum.ghost.org/t/use-partial-parameters-in-get-helper/43016 "2023-11-29T05:55:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sobird](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sobird](https://forum.ghost.org/u/sobird)\
**Post date:** [November 29, 2023, 5:55am UTC](https://forum.ghost.org/t/use-partial-parameters-in-get-helper/43016/1 "2023-11-29T05:55:47Z")

</div>

It’s possible to use post, page or tag data in `#get` queries (eg `filter="tag:{{primary_tag.slug}}"`). The helper expands the content before executing the query. But it doesn’t seem to do the same with partial parameters.

Eg in the “parent” template, I have  
`{{> child-posts order="id asc"}}`

And then in the child-posts partial I have  
`{{#get "posts" order="{{order}}"}} {{posts.length}} {{/get}}`

This doesn’t seem to work – I only get posts if I hard-code `order="id asc"`. Using the parameter, the posts.length doesn’t print, which suggests the entire ‘get’ failed for being malformed.

This would be really helpful for DRY in my templates. Is there a syntax that can do this?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [November 29, 2023, 6:36am UTC](https://forum.ghost.org/t/use-partial-parameters-in-get-helper/43016/2 "2023-11-29T06:36:36Z")

</div>

Have you tried directly passing the property? i.e. `{{#get "posts" order=order}}`

If that doesn’t work, can you confirm that the argument to the partial is defined in the same block context as the `{{#get}}` helper?

ref: [Expressions | Handlebars](https://handlebarsjs.com/guide/expressions.html#helpers)

---

<div class="post-metadata">

**Author:** ![sobird](https://avatars.discourse-cdn.com/v4/letter/s/6f9a4e/32.png) [@sobird](https://forum.ghost.org/u/sobird)\
**Post date:** [November 29, 2023, 7:24am UTC](https://forum.ghost.org/t/use-partial-parameters-in-get-helper/43016/3 "2023-11-29T07:24:11Z")

</div>

Oh awesome, thank you so much!

Trying to understand the logic/pattern of when to use / not use moustaches: when inside a helper (as in, inside the get moustachaes), should they only be used if concatenating in a string?

I find the handlebars’ native documentation extremely hard going tbh, even by API-doc standards. They’re fine as a syntax refresh, but they don’t give context in their examples to help the newbie figure out what’s going on (as for example: when things do and do not need to be in moustaches), so they’re really hard to learn from. The course from the ghost docs is unfortunately a dead link, now.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [November 29, 2023, 5:40pm UTC](https://forum.ghost.org/t/use-partial-parameters-in-get-helper/43016/4 "2023-11-29T17:40:30Z")

</div>

From my recollection, Ghost actually does the handlebars interpolation, it’s not something that’s natively done. So it’s something that’s helper/parameter-specific.

I agree that the handlebars docs could be improved, it took me a few tries to find that specific section 😅

e: cc @RyanF the Treehouse link in [Ghost Handlebars Themes - Building a custom Ghost theme - Docs](https://ghost.org/docs/themes/#handlebars) is broken!
