Skip to content
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

Unable to build liquid Form_Wrapper #8021

Closed
TFleury opened this issue Dec 16, 2020 · 2 comments · Fixed by #8024
Closed

Unable to build liquid Form_Wrapper #8021

TFleury opened this issue Dec 16, 2020 · 2 comments · Fixed by #8024

Comments

@TFleury
Copy link
Contributor

TFleury commented Dec 16, 2020

It seems it's not possible to override Form_Wrapper with Liquid.

The default Razor template is :

...
<form id="@formId" action="@formPart.Action" method="@formPart.Method"  enctype="@encType" class="form-content @formContentTypeClassName">
    @if (formPart.EnableAntiForgeryToken)
    {
        @Html.AntiForgeryToken()
    }

    @await DisplayAsync(Model.Metadata.ChildContent)
</form>

So, the Liquid equivalent should be :

...
<form action="{{ formPart.Action }}" method="{{ formPart.Method }}" enctype="{{ encType }}" class="form-content {{ formContentTypeClassName }}">
    {% if formPart.EnableAntiForgeryToken %}
        {% antiforgerytoken %}
    {% endif %}

  {{ Model.Metadata.ChildContent | shape_render }}
</form>

But Model.Metadata.ChildContent doesn't evalutes in Liquid, and it's not IShape but IHtmlContent.

@jtkech
Copy link
Member

jtkech commented Dec 16, 2020

Can't right now but i will take a look asap

I think the fix should be easy, maybe just also check that it is an IHtmlContent in the filter

TFleury added a commit to Codinlab/OrchardCore that referenced this issue Dec 16, 2020
and allow to render IHtmlContent with shape_render filter
jtkech pushed a commit that referenced this issue Dec 17, 2020
and allow to render IHtmlContent with shape_render filter
TFleury added a commit to Codinlab/OrchardCore that referenced this issue Mar 19, 2021
@sebastienros
Copy link
Member

Note that @await DisplayAsync(Model.Metadata.ChildContent) should actually be @Model.Metadata.ChildContent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants