Variable pass to Scriban example.
See original GitHub issueHi!
I am fairly inexperienced with web dev, so some concepts are passing me by. In particular, I have never used (or even heard of) Scriban before.
I have a working version of the website, using a series of html pages loaded at start as such:
ModScriban.Page(Resource.FromAssembly(Path + ".html")).Title(Name);
I am now trying to change variables being passed through at runtime, which I assume is the purpose of the scriban example in the docs (which mentions a ShopModel and Basket variable). I have attempted to implement this in my own way, as so:
public class AIModel : PageModel
{
public string DOut { get; }
public AIModel(IRequest request, IHandler handler, string dOutput) : base(request, handler)
{
DOut = dOutput;
}
}
//Example of my constructor:
return ModScriban.Page(Resource.FromAssembly(Path + ".html"), (request, handler) => new AIModel(request, handler, "5"));
This is just a tester, meant to output the string “5” to the area specified on the site.
Inside the html file being loaded, I have put two lines (I wasnt sure which variable would be referenced).
{{DOut}} {{dOutput}}
In the area of the page where these would show, I am seeing absolutely nothing however. Is my entire flow wrong, or have I just missed a step?
PasteBins Website Constructor Page Constructor HTML
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)

Top Related StackOverflow Question
Thanks for the info! May do so when I get the chance, but its not high priority, and you have a lot on your hands 😃
I had a look at the .zip you provided, the entire process is immediately clearer 😃 I spent some time converting my system to that model, works perfectly!
The project templates sound like a really good idea, i did most of my learning from the Demo template in the .Themes repo.
Good to know its based on bootstrap! I have a small amount of experience with it, so thats a plus 😃
Your help has been massively appreciated here 😃