Lombiq Helpful Libraries - Orchard Core Libraries - Liquid for Orchard Core
June 9, 2025 ยท View on GitHub
Contains supplementary extensions and services for using Liquid in Orchard Core.
The ILiquidPropertyRegistrar service interface
Implement this to define Liquid properties that rely on other services and async resolution. This way you can save a lot of boilerplate and inject services the usual way.
Note: Use services.RegisterLiquidPropertyAccessor<TImplementation>(propertyName) instead of services.AddScoped(). That's handled by the extension.
Filters
DisplayChildrenLiquidFilter: Tries to convert the input object intoIShapeand render the contents of theIShape.Metadata.ChildContentproperty. This is usually not accessible to Liquid if the input is in some other view-model type that obscuresIShapeproperties. Usage:{{ Model | display-children }}
Extensions
LiquidServiceCollectionExtensions: Used for registering related services, likeRegisterLiquidPropertyAccessor()to register new properties.RegisterLiquidPropertyAccessor: Allows registering a new Liquid property with the provided name.AddLiquidParserTag: Configures theLiquidViewOptionswith an additional parser tag, like{% my_tag "arg1", "arg2" %}.AddLiquidEmptyTag: Configures theLiquidViewOptionswith an additional tag that takes no arguments. Use this if you want to add a tag like{% tag_that_writes_out_a_string %}.
TemplateOptionsExtensions: Used for registering accessors with the Liquid engine inside aservices.Configure<TemplateOptions>(options => ...)call.