Lukas Oppermann
Lukas Oppermann

Reputation: 2938

Handlebars load template from sibling folder

I have the following folder setup

I would now like to include a handlebars template from portfolio into a template from partials, however it does not work.

I tried many variations of:

{{>"../portfolio/item"}}

Is there a way to do this and if so, how? Thanks.

Upvotes: 1

Views: 983

Answers (1)

Lukas Oppermann
Lukas Oppermann

Reputation: 2938

As far as I figured out this is not possible. However I settled for using a base layout with inlines.

This article helped me for my new approach: https://cloudfour.com/thinks/the-hidden-power-of-handlebars-partials/

I created "layouts/base.hbs" and inside used includes:

{{> portfolio/item
  hero-src="http://fpoimg.com/500x200"
  hero-alt="Hero 1 alt title"
}}

Upvotes: 1

Related Questions