Skip to content
Discussion options

You must be logged in to vote

In OC You can extend liquid options by adding template options in module startup

services.Configure<TemplateOptions>(o =>
            {

var lowercase = new FunctionValue((args, context) => 
{
  var firstArg = args.At(0).ToStringValue();
  var lower = firstArg.ToLowerCase();
  return new ValueTask<FluidValue>(new StringValue(lower));
});

                o.Scope.SetValue("lowercase”, lowercase);
                });

Replies: 1 comment 1 reply

Comment options

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

Answer selected by DotCat1985
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