Forum Discussion

Bernd Verhofstadt's avatar
Bernd Verhofstadt
Iron Contributor
Aug 06, 2018
Solved

SharePoint Modern (task/project) Timeline

Hi,

As we are moving to modern pages, I'm looking for a solution to embed the SP Task timeline (included in the site feature Project Functionality) to a modern page.

What would be the best way to achieve this?

Build a webpart from scratch and only parse the data or port/embed the classic webpart to modern spfx?

Has anyone did this before?

 

Cheers

Bernd

 

 

  • Until Microsoft releases a modern UI for Tasks Lists and accordingly to some Project Online features, the only way to go is create a custom SPFx WebPart (or just check if someone has already created that WebPart)

10 Replies

  • Donia Strand's avatar
    Donia Strand
    Iron Contributor

    We could really use this! Would love to see the modernized task web part. Is it on the roadmap?

    • albert2049's avatar
      albert2049
      Copper Contributor

      Hi All,

       

      The idea of using an iframe for the calendar gave me the idea of using it for a timeline. After removing all the surrounding clutter and changing the style a little bit, I think it looks pretty seamless within a modern page.

       

      If anyone wants to try this, here is what I did:

      • I created a new classic page that only has a timeline. This page, however, has a lot of clutter, like menus and old classic styles that need to be removed/modified.
      • So I added a Content Editor web part that references another file on my system. In this file I added a style tag with some css that removes all the clutter and changes some of the classic styles. It's better to do it this way than inside a Script Editor because once your css hides the menus, you won't be able to interact with the edit menus anymore. I used SharePoint Designer to edit the css outside of the browser.
      • Finally I added an Embed web part on my modern page, with an iframe tag referencing my classic page. I had to play around with the dimensions until it looked good (no clipping or excess white space).
      • Here is my css. It will probably be different for your page depending on your template. I spent quite a bit of time inside Chrome devtools to figure this out, but this should give you an idea of what you need to change.

       

      	#ms-designer-ribbon,
      	#s4-titlerow,
      	#sideNavBox,
      	#MSOZoneCell_WebPartWPQ2 > div > div > table,
      	#WebPartWPQ3_ChromeTitle,
      	#MSOZoneCell_WebPartWPQ3,
      	.welcome-content {
      		display: none !important;
      	}
      	#MSOZoneCell_WebPartWPQ2 {
      		padding: 10px;
      	}
      	#s4-ribbonrow {
      		height: 35px;
      	}
      	#contentBox {
      		margin-left: 0;
      	}
      	#contentRow {
      		padding: 0;
      	}
      	div.welcome {
      		padding: 0;
      	}
      	.ms-webpart-titleText {
      		font-size: 24px;
      	}
      	.ms-WPBorder {
      		border-style: none;
      	}
      	.ms-webpart-chrome-title {
      		border-style: none;
      	}
      	.ms-webpart-chrome-title span {
      		color: rgb(51, 51, 51);
      		font-weight: 100;
      	}
      
      ​

       

      Overall I think this is a decent approach. It leverages all the work that was put into the classic timeline, and the ugly hacks stay in the classic page. And when/if Microsoft comes out with a new timeline webpart, it is easily replaced.

       

      Albert

  • Ideally the web part should come from MS, but I looked at this some weeks ago and building a SPFx web part seems feasible.

    The information you need seems to be stored in a property of the root site folder as a block of XML.
    Unfortunately I had no time to try it...
     
    I found some blog posts detailing this, hope they can be of some help:
  • Until Microsoft releases a modern UI for Tasks Lists and accordingly to some Project Online features, the only way to go is create a custom SPFx WebPart (or just check if someone has already created that WebPart)

    • Bernd Verhofstadt's avatar
      Bernd Verhofstadt
      Iron Contributor

      Thanks, couldn't found a spfx webpart on GitHub :-) Once I have a first version of the webpart done, I'll check to make it open source.

       

      Cheers

      Bernd

      • Deleted's avatar
        Deleted

        Did you ever find a way to show the timeline on a modern page?

Resources