We are using DXA for implementation of our website. There is strange behavior when XPM is applied. This is scenario
- Schema has mandatory and non-mandatory fields, lets take just text fields as examples.
- Rendering is OK in the case of mandatory field or non-mandatory field which has some text and source of the page is like
- If the field is non-mandatory and without value, output is different and looks like this
As it can be noticed there is no XPM comment which will give the information about which field should be editable with XPM.
- Code in View used to render non-mandatory fields is
WebRequestContext.IsPreview
is always true for our current development environment so that part is ok.
Model.TipText
is null in that case, and maybe this is causing the issue.
Problem is related to the output because there is XPM related comment in the source of the page, so XPM does not recognize there is field without value which should be allowed for editing. Without this comment there is no placeholder "<< add text >>" when XPM is active.
Also it is tried with different approach and placing first div
as it is on the following image, but same issue is there
So, how we can fix this issue? Why there is no XPM related comment which is necessary mark some field as editable through XPM?