Skip to content

Import Liquid Map into set-body #76

Answered by Mielek
WarrenKinley asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @WarrenKinley! Thank you using toolkit! I will try to help you here.

If I understand correctly, you have a file which contains a body. This file contains a liquid template. What you want to achieve is to paste the file as a content for the policy in similar manner as below

context.SetBody(File.ReadAllText("body.liquid"), new SetBodyConfig() { Template = "liquid" });

Currently, compiler does not support loading external files. You need to copy and paste the value in the policy itself. e.g.

context.SetBody(
"""
Your liquid template
""", new SetBodyConfig {
  Template = "liquid",
});

I think, this is a great idea to create an improvement to the compiler.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@WarrenKinley
Comment options

Answer selected by WarrenKinley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants