answerstu

Is it possible to call a method from a DotLiquid template?

Clearly, you can call properties, but calling a method doesn't do anything, even on a class that extends from Drop.I'm trying to do something like this in my XmlDocumentDrop class.public string XPath{ return xmlDoc.DocumentElement.SelectSingleNode(xpath).InnerText;}Then in my DotLiquid template.{{ xmlDoc.XPath("//firstName") }}This returns nothing.I have tried to use the "CatchAll" method, but I'm trying to pass XPath, and it seems to strip out all non-word characters. So, trying to do this:{{ xmlDoc.//firstName }}Just sends "firstName" to Be...Read more

How to get the filepath when using DotLiquid Include Method?

I was create Include method, like below code.the products.liquid like below{% include product-list-item %}The include method like below:public class IncludeFileSystem : IFileSystem{ public string ReadTemplateFile(Context context, string templateName) { string themesLocalPath = ""; var templatePath = LiquidTemplateHelper.ResolveTemplatePath(templateName, themesLocalPath); return LiquidTemplateHelper.ReadTemplateByPath(templatePath); }}but for different users, they load different "product-list-item" from the file.How...Read more