New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Fluid instead of DotLiquid #823
Conversation
@@ -1,7 +1,7 @@ | |||
| |||
Microsoft Visual Studio Solution File, Format Version 12.00 | |||
# Visual Studio 15 | |||
VisualStudioVersion = 15.0.26505.0 | |||
VisualStudioVersion = 15.0.26606.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they really need to remove this from VS..
public WhereDrop Where => new WhereDrop(this); | ||
public SkipDrop Skip => new SkipDrop(this); | ||
public TakeDrop Take => new TakeDrop(this); | ||
//using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete
{ | ||
throw new ArgumentException("Content Item was expected"); | ||
} | ||
var contentItem = input.ToObjectValue() as ContentItem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we not have a ToObjectValue() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
input is a FluidValue
it wraps any CLR object. So yes we want to get the wrapped content item then cast it.
{ | ||
_contentDefinitionManager = contentDefinitionManager; | ||
_liquidManager = liquidManager; | ||
} | ||
|
||
public override void GetContentItemAspect(ContentItemAspectContext context, LiquidPart part) | ||
{ | ||
context.For<BodyAspect>(bodyAspect => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not use async await on the lambda of the For?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No because GetContentItemAspect
is not async.
That doesn't matter right now as I create this #822 which will solve it.
context.MemberAccessStrategy.Register(model.GetType()); | ||
|
||
var html = await template.RenderAsync(context); | ||
@Html.Raw(html ?? "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"" or HtmlString.Empty ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - a few comments, but no show stoppers.
An example to test the feature:
With this sql query