#StackBounty: #sharepoint-online #office-365 #display-template #content-search-web-part PDF Files not opening when clicked from the con…

Bounty: 50

I wrote a custom display template for a content search web part that shows recent documents edited or modified by a user. I added hover functionality as well to allow users to hover.

For some reason though, PDF files are not opening when clicked from the web part. It just reloads the page and does not open at all. All other files are opening fine and I can edit as well like word file, excel etc.

Below is the Display template code I wrote by copy pasting code from two lines template initially and then added other customization inside:

<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"> 
<head>
<title>TE Item RecentDocs</title>

<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden>
<mso:ManagedPropertyMapping msdt:dt="string">'Link URL'{Link URL}:'Path','Line 1'{Line 1}:'Title','Line 2'{Line 2}:'','FileExtension','ServerRedirectedEmbedURL','ServerRedirectedEmbedURL','HitHighlightedProperties':'HitHighlightedProperties','HitHighlightedSummary':'HitHighlightedSummary','ParentLink':'ParentLink'</mso:ManagedPropertyMapping>
<mso:MasterPageDescription msdt:dt="string">This Item Display Template will show a preview and properties for Record Center Customer Documents</mso:MasterPageDescription>
<mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106603</mso:ContentTypeId>
<mso:TargetControlType msdt:dt="string">;#SearchResults;#Content Web Parts;#</mso:TargetControlType>
<mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
<mso:HtmlDesignConversionSucceeded msdt:dt="string">True</mso:HtmlDesignConversionSucceeded>
<mso:HtmlDesignStatusAndPreview msdt:dt="string">https://***.sharepoint.com/_catalogs/masterpage/Display Templates/Content Web Parts/TE_Item_RecentDocs.html, Conversion successful.</mso:HtmlDesignStatusAndPreview>
<mso:CrawlerXSLFile msdt:dt="string"></mso:CrawlerXSLFile>
<mso:HtmlDesignPreviewUrl msdt:dt="string"></mso:HtmlDesignPreviewUrl>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</head>

<body>

    <!--
            Warning: Do not try to add HTML to this section. Only the contents of the first 
inside the tag will be used while executing Display Template code. Any HTML that you add to this section will NOT become part of your Display Template. --> $includeLanguageScript(this.url, "~sitecollection/_catalogs/masterpage/Display Templates/Language Files/{Locale}/CustomStrings.js");
</div> <a class="cbs-ItemLink" title="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= pictureLinkId =#_"> <img class="cbs-Thumbnail" src="_#= $urlHtmlEncode(iconURL) =#_" alt="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= pictureId =#_" /> </a>
_#= line1 =#_
_#= line2 =#_
<!--#_ } _#--> </div> </div> </div> </body> </html>

FYI, Inside Property Mappings, I have set the LinkURL to ServerRedirectedURL. Can someone please help me modify this code so that users can also open PDF documents when clicked, thanks in advance.


Get this bounty!!!

#StackBounty: #workflow #office-365 #tasks 'Open this Task' button missing from Office documents opened from SharePoint Online

Bounty: 100

If I have a Workflow Task assigned to me from on-premise SharePoint, when I open the related document, I see a WORKFLOW TASKS: Please approve …. alert in the ribbon as shown below. This call-out does not show when opening a document in Office 365 that has an associated workflow task. I can kick off the approval workflow, which sends an email to the approver. The approver opens the document but the ‘WORKFLOW TASK’ callout is not shown.

This behavior can be observed from Office 2010 and 2013 when opening directly from SharePoint.

What am I missing?

Workflow Task


Get this bounty!!!

#StackBounty: #workflow #office-365 #tasks 'Open this Task' button missing from Office documents opened from SharePoint Online

Bounty: 100

If I have a Workflow Task assigned to me from on-premise SharePoint, when I open the related document, I see a WORKFLOW TASKS: Please approve …. alert in the ribbon as shown below. This call-out does not show when opening a document in Office 365 that has an associated workflow task. I can kick off the approval workflow, which sends an email to the approver. The approver opens the document but the ‘WORKFLOW TASK’ callout is not shown.

This behavior can be observed from Office 2010 and 2013 when opening directly from SharePoint.

What am I missing?

Workflow Task


Get this bounty!!!

#StackBounty: #workflow #office-365 #tasks 'Open this Task' button missing from Office documents opened from SharePoint Online

Bounty: 100

If I have a Workflow Task assigned to me from on-premise SharePoint, when I open the related document, I see a WORKFLOW TASKS: Please approve …. alert in the ribbon as shown below. This call-out does not show when opening a document in Office 365 that has an associated workflow task. I can kick off the approval workflow, which sends an email to the approver. The approver opens the document but the ‘WORKFLOW TASK’ callout is not shown.

This behavior can be observed from Office 2010 and 2013 when opening directly from SharePoint.

What am I missing?

Workflow Task


Get this bounty!!!

#StackBounty: #workflow #office-365 #tasks 'Open this Task' button missing from Office documents opened from SharePoint Online

Bounty: 100

If I have a Workflow Task assigned to me from on-premise SharePoint, when I open the related document, I see a WORKFLOW TASKS: Please approve …. alert in the ribbon as shown below. This call-out does not show when opening a document in Office 365 that has an associated workflow task. I can kick off the approval workflow, which sends an email to the approver. The approver opens the document but the ‘WORKFLOW TASK’ callout is not shown.

This behavior can be observed from Office 2010 and 2013 when opening directly from SharePoint.

What am I missing?

Workflow Task


Get this bounty!!!

#StackBounty: #workflow #office-365 #tasks 'Open this Task' button missing from Office documents opened from SharePoint Online

Bounty: 100

If I have a Workflow Task assigned to me from on-premise SharePoint, when I open the related document, I see a WORKFLOW TASKS: Please approve …. alert in the ribbon as shown below. This call-out does not show when opening a document in Office 365 that has an associated workflow task. I can kick off the approval workflow, which sends an email to the approver. The approver opens the document but the ‘WORKFLOW TASK’ callout is not shown.

This behavior can be observed from Office 2010 and 2013 when opening directly from SharePoint.

What am I missing?

Workflow Task


Get this bounty!!!

#StackBounty: #workflow #office-365 #tasks 'Open this Task' button missing from Office documents opened from SharePoint Online

Bounty: 100

If I have a Workflow Task assigned to me from on-premise SharePoint, when I open the related document, I see a WORKFLOW TASKS: Please approve …. alert in the ribbon as shown below. This call-out does not show when opening a document in Office 365 that has an associated workflow task. I can kick off the approval workflow, which sends an email to the approver. The approver opens the document but the ‘WORKFLOW TASK’ callout is not shown.

This behavior can be observed from Office 2010 and 2013 when opening directly from SharePoint.

What am I missing?

Workflow Task


Get this bounty!!!

#StackBounty: #workflow #office-365 #tasks 'Open this Task' button missing from Office documents opened from SharePoint Online

Bounty: 100

If I have a Workflow Task assigned to me from on-premise SharePoint, when I open the related document, I see a WORKFLOW TASKS: Please approve …. alert in the ribbon as shown below. This call-out does not show when opening a document in Office 365 that has an associated workflow task. I can kick off the approval workflow, which sends an email to the approver. The approver opens the document but the ‘WORKFLOW TASK’ callout is not shown.

This behavior can be observed from Office 2010 and 2013 when opening directly from SharePoint.

What am I missing?

Workflow Task


Get this bounty!!!

#StackBounty: #workflow #office-365 #tasks 'Open this Task' button missing from Office documents opened from SharePoint Online

Bounty: 100

If I have a Workflow Task assigned to me from on-premise SharePoint, when I open the related document, I see a WORKFLOW TASKS: Please approve …. alert in the ribbon as shown below. This call-out does not show when opening a document in Office 365 that has an associated workflow task. I can kick off the approval workflow, which sends an email to the approver. The approver opens the document but the ‘WORKFLOW TASK’ callout is not shown.

This behavior can be observed from Office 2010 and 2013 when opening directly from SharePoint.

What am I missing?

Workflow Task


Get this bounty!!!