Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top