Open arkadiuszwojcik opened 3 years ago
@arkadiuszwojcik I guess yes, default Prefix
is name of the type of Model and ContentDisplayDriver
has ContentItem
as Model.
@arkadiuszwojcik I believe this only happens when you use Liquid widget
in FlowPart
, layers
and not when used in liquid Templates
.
@ns8482e I had this issue using this code directly in my LiquidPage
Content Definition (simple LiquidPart
wrapper in my project) so no FlowPart
, Layers
were involved. And my LiquidPage
is rendered directly in main Layout.
@ns8482e This is what I found so far. Prefix is appended by inter MVC method: GetFullHtmlFieldName
executing while generating fields. Prefix is obtained this way: var htmlFieldPrefix = viewContext.ViewData.TemplateInfo.HtmlFieldPrefix;
In our case it is ContentItem
that is why finally we see: ContentItem_FieldName
I don't understand one thing. Why when I use Form with some Workflow (as backend) I don't get any ContentItem prefixes for model fields. But when I use very same form against custom Controller then this prefix is appended? It is very incosistient behaviour.
I have question regarding previous issue I reported: #4426 Looks like it was solved by: #5099
Today I made test by replacing my custom tag helper:
{% helper "form-input", id:'Name', name:'Name', placeholder:'Your name', class:'form-control' %}
with:
{% helper "input", for: "Name", placeholder:'Your name', class: "form-control" %}
And the result I get is:
<input placeholder="Your name" class="form-control" type="text" id="ContentItem_Name" name="ContentItem.Name" value="">
instead of my previous:
<input id="Name" placeholder="Your name" class="form-control" name="Name" value="">
Notice:
ContentItem_
andContentItem.
prefix. Is it exected behaviour? I would not expect any prefix beforeName
/cc @ns8482e @jtkech