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

Include tag behavior #875

Closed
Geolim4 opened this issue Oct 11, 2023 · 4 comments
Closed

Include tag behavior #875

Geolim4 opened this issue Oct 11, 2023 · 4 comments

Comments

@Geolim4
Copy link
Contributor

Geolim4 commented Oct 11, 2023

Hello, following my last contribution I was wondering how the {% include 'xxxx' %} is supposed to work ?

Does it make a xhr/fetch request to retrieve the template (depending the base parameter, or does it just query a "register"' that contain a list of preloaded template file ?

Sorry but the documentation lack of examples et demos, I'd like some enlightenments ;D

Thans you again.

@willrowe
Copy link
Collaborator

It depends on your use case. If you are trying to render templates in the browser this might help.

@Geolim4
Copy link
Contributor Author

Geolim4 commented Oct 17, 2023

It depends on your use case. If you are trying to render templates in the browser this might help.

Thanks I tried this wiki already, but I'm not sure if an inline template supports the include tags. I'm fetching by myself the twig template for some reason, so I'm passing it as an content to twig lib.

@ericmorand
Copy link
Contributor

Thanks I tried this wiki already, but I'm not sure if an inline template supports the include tags.

According to the spec, it does: an inline template is no different than another type of template. Actually, there is no such thing as inline templates: there are just, well, templates.

@Geolim4
Copy link
Contributor Author

Geolim4 commented Oct 20, 2023

Hmm tried path and href option, did not worked. I implemented my own "include" function with async fetch and it works fine. Thank you anyway.

@Geolim4 Geolim4 closed this as completed Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants