dotliquid / dotliquid

.NET Port of Tobias Lütke's Liquid template language.
http://dotliquidmarkup.org
Other
1.06k stars 296 forks source link

How to use 'Include' tag with The 'with' parameter #168

Closed eminyuce closed 8 years ago

eminyuce commented 8 years ago

I am developing asp.net mvc web application with dotliquid view engine and want to use 'Include' tag with The 'with' parameter so that it will be like partial view like below.

 {% include 'test' with model.ProductLiquid  %}

My model class has lots of different liquid classes and one of them is ProductLiquid class. It is working fine if I want to print product name {{ model.ProductLiquid.Name }}

That is the my _text.liquid file... It is writing 'test2' without product name. _test.liquid test2 {{ ProductLiquid.Name }} _test.liquid, not working as well. test2 {{ model.Name }}

How to use 'Include' tag with The 'with' parameter so that I will be using same liquid file

eminyuce commented 8 years ago

I tried that one and it works

{% assign product = model.ProductLiquid %} {% include 'test' with product %}