fluid icon indicating copy to clipboard operation
fluid copied to clipboard

Supports Razor pages or Blazor?

Open HybridSolutions opened this issue 2 years ago • 7 comments

Hi,

can Fluid be used with Razor Pages or with Razor Components? If yes, any example?

Thank you!

HybridSolutions avatar Apr 09 '22 01:04 HybridSolutions

Fluid is a template language like Razor, why you need to mix both of them?

hishamco avatar Apr 10 '22 14:04 hishamco

Fluid is a template language like Razor, why you need to mix both of them?

hishamco avatar Apr 10 '22 14:04 hishamco

Fluid is a template language like Razor, why you need to mix both of them?

Because I need templates that don't have to be recompiled each time a change in HTML like a CSS class added to a DIV and this happens with .razor or .cshtml files.

HybridSolutions avatar Apr 12 '22 09:04 HybridSolutions

Did you try MvcViewEngine?

hishamco avatar Apr 12 '22 13:04 hishamco

that don't have to be recompiled each time

I think you also imply "at build time". Fluid is not recompiled on every change, it is interpreted, while the application is running, not at build time.

Later improvement will also provide dynamic compilation of fluid templates. Still not at build time (like you want).

Fluid can be called from Razor pages, views and components if you need to delegate part of the templates from another view.

sebastienros avatar Apr 12 '22 15:04 sebastienros

I want to be able to make changes to templates at runtime without having to compile the hole web project like I do now with Blazor or even Razor Pages if not using RuntimeCompilation package. Been using Dotnetliquid in webforms and it worked great. Fluid seems more up to date but it would be nice to have some more examples of integration with .NET 6, Razor Pages or Blazor.

HybridSolutions avatar Apr 12 '22 15:04 HybridSolutions

There is no specific integration to provide or document. You can run C# code in a view, and all the currently provided samples will work the same way:

@{
 // ANY SAMPLE FROM DOCUMENTATION
}

sebastienros avatar Apr 12 '22 15:04 sebastienros