Closed julkue closed 4 years ago
Hey there. I'd like to see this one get merged into master if at all possible. I'm happy to make the change if that helps?
I've got a couple of comments before we move any further:
@render
tag, or any component location services?render
and is only compatible with include
(Error: You must provide a valid component handle to the render tag.
)Is there any way we can get it working with render
? I appreciate it's native Twig functionality, but I'm really apprehensive to break core Fractal functionality.
Re: documentation, the option itself needs documenting. If we decide to merge anyway, then the lack of @render
support needs addressing. Basically, how to you use it and what does it do.
There's a documented option to change the handle prefix but it doesn't seem to work. I can't get it to work. If it did work then you could use namespaces and then override the handle prefix to something else like in the example: %
// use custom handle prefix
// this will change your includes to {% include '%button' %}
// default is '@'
handlePrefix: '%',
I've just had a look at this and like @Webslung says the handlePrefix
option doesn't appear to actually work, have any of you guys successfully had that working at any point? I'm wondering if it's just broken on this adapter. I think if that was working it would be a decent solution for this issue, as there would still be a decent fallback for people that want to use the {% render %}
tag with this adapter.
Is there any follow up to any of the questions here? If not, I'm tempted to close rather than merge. I'll leave it a week or two though.
I'll try to fix the handlePrefix option for render tag & then finish up this PR. It's a nice feature to support.
I've updated this PR with the latest updates from master and fixed the issues.
Added docs that reference the twig.js docs on how to use namespaces. Also added comment that it may break fractal default functionality. All in all, I'm not too concerned about that since together with #43 we will allow usage of this adapter with default twig.js behavior.
Of course, if in future we find a way to make everything work at once, new PRs are welcome :)
https://github.com/justjohn/twig.js/wiki#user-content-namespaces
Allows specifying e.g.
to then use:
I needed this because I'm using
@Components
in my backend to reference to the components frontend folder.