1

I am creating a page layout for SharePoint Online using SP Designer 2013. Site columns are added using Design Manager Page Fields snippets. Fields are rendered correctly but the 'Description' and 'Required(*)' properties are not shown in edit mode. Any idea why this is happening?

<div data-name="Page Field: XYZ"><!--CS: Start Page Field: XYZ Snippet--><!--SPM:<%@Register Tagprefix="PageFieldDropDownChoiceField" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>--><!--MS:<PageFieldDropDownChoiceField:DropDownChoiceField FieldName="XYZ" runat="server">--><!--PS: Start of READ-ONLY PREVIEW (do not modify)--><div align="left" class="ms-formfieldcontainer"><div class="ms-formfieldlabelcontainer" nowrap="nowrap"><span class="ms-formfieldlabel" nowrap="nowrap">XYZ</span></div><div class="ms-formfieldvaluecontainer"></div></div><!--PE: End of READ-ONLY PREVIEW--><!--ME:</PageFieldDropDownChoiceField:DropDownChoiceField>--><!--CE: End Page Field: XYZ Snippet--> </div>

1 Answer 1

0

To show field properties, like description, you need to reference Microsoft.SharePoint.WebControls. That reference should already be in the Page Layout but here is it just in case :

<!--SPM:<%@Register Tagprefix="SharePoint"  Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>-->

That namespace contains a class FieldProperty that can be used to get a field properties.

<!--SPM:<SharePoint:FieldProperty FieldName="MyCustomField" PropertyName="Description" runat="server" />-->
<!--SPM:<SharePoint:FieldProperty FieldName="MyCustomField" PropertyName="Required" runat="server" />-->

The "FieldName" attribute can be the internal name or the GUID of the field.

Need more extra work for something that should already be there ? You will need to format the "Required" value, because it will show you TRUE | FALSE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.