Skip to content

How to resolve include / render tag in template that is from database? #414

Answered by harttle
Huai-Kang asked this question in Q&A
Discussion options

You must be logged in to vote

For the partial reference part, try the recently added relativeReference option (enabled by default). Add both hosts into root option, then include partials by relative path, like {% include './product' %} instead of {% include 'product' %}.

For the cross origin {% include %}, maybe you'll need to specify the absolute URL to make it work, like {% include "https://example.com/product.liquid" %}. Or, alternatively, you can invent an "abstracted FS" (implement multi domain by pseudo-directory), like:

foo.com/foo.liquid -> https://foo.com/<any prefix>/foo
bar.com/bar.liquid -> https://foo.com/<any prefix>/bar

Then in foo.liquid, include bar.liquid by {% include "../bar.com/bar.liquid" %}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Huai-Kang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants
Converted from issue

This discussion was converted from issue #413 on October 15, 2021 14:41.