0

If I place the following tag within my custom page layout:

<!--MS:<SharePoint:FieldValue FieldName="Title" runat="server"/>-->

I can clearly see that it displays the title of the page.

But how can I convert this into an input box when I go to edit my publishing page, and simply change the value from this input box? What would the code look like?

2

You need to use the TextField control, instead of a FieldValue. A FieldValue is always read-only, even in an EditModePanel (see my comment as well).

So, just replace "FieldValue" with "TextField" and you should be good to go. It will render a label in display mode, and a text box in edit mode.

| improve this answer | |
0

you should insert a snippet in you page layout that containing a panel EditModePanel and inside of the EditModePanel you should insert the reference of field want show in edition mode

a Example without snippet:

<PublishingWebControls:EditModePanel runat=server id="EditModePanelA" PageDisplayMode="Display">
       <SharePointWebControls:FieldValue runat="server" id="ImageFieldValue" FieldName="PublishingPageImage"/>
       <SharePointWebControls:FieldValue runat="server" id="ImageFieldValue2" FieldName="PageImage2"/>
</PublishingWebControls:EditModePanel>

with snippet would be something as this: (I think it would be of this so, sorry)

<!--MS:<PublishingWebControls:EditModePanel runat=server id="EditModePanelA" PageDisplayMode="Display">
       <SharePointWebControls:FieldValue runat="server" id="ImageFieldValue" FieldName="PublishingPageImage"/>
       <SharePointWebControls:FieldValue runat="server" id="ImageFieldValue2" FieldName="PageImage2"/>
</PublishingWebControls:EditModePanel>-->
| improve this answer | |
  • SOrry this is not true. It would only display them, in edit mode. An EditModePanel is meant to only show those controls in EditMode. – Boland Aug 6 '15 at 2:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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