3

Is it possible to edit the page layout of the display form of a list?

I really would like to have the option to add webparts to the right of the dsplay form on a list. However the default display form only includes one webpartzone thus I'm only able to add more webparts above or below the form.

Please note I'm not asking about adding a new webpart, but instead adding a new webpart zone.

Also I would like to awoid creating a custom display form as new fields in the list is hidden in custom display forms.

4

It's quite possible. Just pop open SharePoint Designer and navigate to it. /Lists/MyListName/Forms/DispForm.aspx. Just make sure you don't modify the original DispForm.aspx. You always want to keep that as a backup. Just right click on DispForm.aspx and make a copy. Or you can select Lists and Libraries, select your list, and use the interface in the right hand column to create a new Display Form and set it as default.

Always remember that even if its a complicated sharepoint page, its just a web page and you can do all your normal web pagey things to it.

A brief example of a two column layout with two web part zones.

<div class="container">
   <div class="left">
       <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Left" Title="Left">
            <ZoneTemplate>
                <WebPartPages:ListFormWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" /> <!-- cut off for brevity -->
            </ZoneTemplate>
       </WebPartPages:WebPartZone>
    </div> 
   <div class="right">
       <WebPartPages:WebPartZone runat="server" FrameType="None" ID="Right" Title="Right">
            <ZoneTemplate>
            </ZoneTemplate>
       </WebPartPages:WebPartZone>
   </div> 
</div>

Edit: Additional Details, just in case. You can open your original DispForm.aspx

Find your <WebPartPages:ListFormWebPart>

Right click on it within designer and choose select Tag. This highlights the entire web part. Right click on the highlighted area and copy. Paste into NotePad in case you need to toy with it later.

Paste it into the web part zone on the other page. This will make sure it acts like the out of the box part so that new sections show up as added.

  • Uhm I cant seem to get that to work - also it does have the unwanted effect of breaking the normal behaviour of the list form (E.g. groups not formattet correctly, new fields not showng up etc.) – Morten K Oct 4 '17 at 12:01
  • What version of SharePoint are you using? Also, you can't copy and paste that directly. I cut off 90% of the ListFormWebPart. Just in case you tried that one. – Jack Oct 4 '17 at 17:03
  • Right now I'm using SP Online. Once I copy the webpart from the "original" DispForm.aspx it is working as expected - so far so good (And thanks a lot). However once i mark the custom display form default the "original" one is removed - and I would like to keep the orginal one as a backup. – Morten K Oct 4 '17 at 19:10
  • So before you do that, navigate directly to the dispform.aspx file. All Files, Lists, Library or List Name, Forms. Then copy it off somewhere. I have folders stuffed full of notepad files where I've copied and pasted off dataviews. Honestly, its probably just sitting there and hiding from you in the other view. – Jack Oct 5 '17 at 9:48
  • Yeah I think I have found the culprit. I copied everything including the webpart ID from the original dispform. When i created a new ID it works! – Morten K Oct 5 '17 at 16:21

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.