You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying out Fractal on a Nunjucks project I'm currently working on and am really impressed with it.
One issue I've encountered is with nested component paths.
By default, it seems I can only include/extend components with the @handle syntax or via the filename (if I first specify a path when configuring the Nunjucks instance).
What I'd like to be able to do is include a component with its full path, e.g.
{% include "path/to/files/component.njk" %}
as this is how they are included in my project.
The only way I can see to achieve this is to add another custom loader into the Nunjucks adapter, along the lines of:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hey,
I've been trying out Fractal on a Nunjucks project I'm currently working on and am really impressed with it.
One issue I've encountered is with nested component paths.
By default, it seems I can only include/extend components with the @handle syntax or via the filename (if I first specify a path when configuring the Nunjucks instance).
What I'd like to be able to do is include a component with its full path, e.g.
{% include "path/to/files/component.njk" %}
as this is how they are included in my project.
The only way I can see to achieve this is to add another custom loader into the Nunjucks adapter, along the lines of:
This takes the filename from the path string and converts it to a handle so it can be passed to the getView method.
It seems to work ok, but was wondering if there was a better way.
Thanks
The text was updated successfully, but these errors were encountered: