1

I am trying to create a site template for a project site. On the home page of the site, I have a Timeline web part (new for SP 2013). When the web part is created, the data source defaults to the site in which it was created.

Fully-qualified URL

However, when I create a site template based off of this site, it keeps the absolute URL as the data source. This makes it so every time I create a site based off of that template, I have to go in and change that URL to the new site's URL.

Is there a way to have the data source be a relative URL so I don't have to change it whenever I create a new site?

Troubleshooting Steps Taken

I have already tried using an App Part for the task list, but the view includes not only the timeline but also the full list. I just want the timeline.

Also, I have tried using just "/template", "/", and even "./" (I was desperate) as the URL, but I get the following error: "The URL provided is invalid or does not have a valid timeline source. Check the provided URL and validate again."

enter image description here

Code

<WebPartPages:SPTimelineWebPart runat="server" TimelineType="TaskListTimeline" PageAddress="/sites/CEOsearch/template" TypeSelection="TaskListTimeline" SourceSelection="326925ea-a1c8-460c-a04c-23c3527e9aac" ListId="326925ea-a1c8-460c-a04c-23c3527e9aac" CurrentTaskListWebAddress="https://connect.contoso.org/sites/CEOsearch/template" ViewName="Timeline" Title="Timeline" FrameType="Default" SuppressWebPartChrome="False" Description="" IsIncluded="True" ZoneID="Right" PartOrder="2" FrameState="Normal" AllowRemove="True" AllowZoneChange="True" AllowMinimize="True" AllowConnect="True" AllowEdit="True" AllowHide="True" IsVisible="True" DetailLink="" HelpLink="" HelpMode="Modeless" Dir="Default" PartImageSmall="" MissingAssembly="Cannot import this Web Part." PartImageLarge="" IsIncludedFilter="" ExportControlledProperties="True" ConnectionID="00000000-0000-0000-0000-000000000000" ID="g_104ab0ec_0427_46ed_a9fc_7c1a412afeae" ExportMode="All" __MarkupType="vsattributemarkup" __WebPartId="{104AB0EC-0427-46ED-A9FC-7C1A412AFEAE}" WebPart="true" Height="" Width=""></WebPartPages:SPTimelineWebPart>

1 Answer 1

0

you can add a script at the end of the page and play with timeline datasource , if you look at the page source you will find some codes like this :

var tldsctl00_ctl33_g_7b5ad475_fefc_4682_ab26_d06bc119acf8 = new SP.UI.Timeline.ListTimelineDatasource(); tldsctl00_ctl33_g_7b5ad475_fefc_4682_ab26_d06bc119acf8.Init("5fb4b4b1-1da4-4eaf-a20d-a1c4952020d4", [{"ListRO":"0","ItemsRO":"0"}], "http://sharepoint/sites/en", "Timeline");

if you can change the url on init the datasource it would solve your problem .

1
  • Added code sample. What should I change the URL to to get it to stay consistent when creating a template? Sep 8, 2015 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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