Change SharePoint List “Display Item Form” Close Button Default Redirect Location

Posted on Updated on


    Most of the times peoples are using display item form to display their list content in a page.By default SharePoint “display item form” Close button redirect you to the default view of the library where your page/document exists or default view of the list where your item exists. Some scenarios we want to change this redirect url. you can use several ways to achieve this. For an example you can use a JavaScript  to achieve the same thing. In my case I’ll show you using a page parameter how we can change the Redirect page of a SharePoint “display item form” close button.In my example I have a list called “News” and I’m going to show the latest news in a different SharePoint page called “News” which is inside the “Site Pages” library.Currently this is my News list default Display Item form Url “http://spfoundation/_layouts/15/start.aspx#/Lists/News/DispForm.aspx?ID=1&Source=http%3A%2F%2Fspfoundation%2FLists%2FNews%2FAllItems%2Easpx” .This means after you click on Close button you will automatically redirect to “News” list default “AllItems.aspx” page.

    1

    So my goal is to change the “&Source” Parameter.

  • Create a new Page.( In my example I created a “Wiki” Page inside my “Site Pages” library.I inserted a header Called “Latest News“)

    2

  • Open the page using “SharePoint Designer

3

  • Insert a new Display Item form

4_1

  • Select your Display Item Form and click “Add/Remove Columns” button in the ribbon.this will brings the “Edit Column” window

6

6

  • Remove unnecessary columns.in my example I used “Title” and “ContentColumn

7

  • Sort using “Id” to show latest Contents (this is not mandatory.You can skip this step)

8

9

  • Find “<xsl:template name=”dvt_1.rowview”>” tag

10

  • Change the table data (<td>) content like below .

11

  • Select the Display Item Form and click on Parameter button.this will open the Data View Parameter Window

12

  • Create a new Parameter called “Source” and for the “Default Value” give your redirect page url.in my example im redirect to my home page and click ok ..

13

  • Add our new parameter at the end of your column url.in my example it’s “Title” column url.

 17

 

  • Save and Close Your Page. That’s it Smile this is how my page looks like

15

  • This is my new Display item Form Url “http://spfoundation/Lists/News/DispForm.aspx?ID=1&Source=http://spfoundation” previously it like this

    “http://spfoundation/_layouts/15/start.aspx#/Lists/News/DispForm.aspx?ID=1&Source=http%3A%2F%2Fspfoundation%2FLists%2FNews%2FAllItems%2Easpx”

16

Happy Coding Smile

Advertisements

5 thoughts on “Change SharePoint List “Display Item Form” Close Button Default Redirect Location

    Kerri Osso said:
    August 18, 2016 at 5:15 AM

    Howdy! I’m at work browsing your blog from my new iphone! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the excellent work!|

      hpksanje responded:
      August 27, 2016 at 7:55 PM

      Thanks Kerri

    darius said:
    December 21, 2016 at 2:44 AM

    a newbie here. can this be done without sharepoint designer?

      hpksanje responded:
      April 8, 2017 at 3:57 PM

      Hi, you have to use SharePoint designer if you’re going use this approach.

    Joseph Malle said:
    March 16, 2017 at 11:57 AM

    Thank you, I’ve just been looking for information approximately this topic for a while and yours is the best I’ve discovered so far. However, what concerning the conclusion? Are you sure in regards to the supply?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s