Display Template Error

%3CLINGO-SUB%20id%3D%22lingo-sub-1459925%22%20slang%3D%22en-US%22%3EDisplay%20Template%20Error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1459925%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20working%20in%20SharePoint%202013%20and%20I've%20customised%20a%20display%20template%20to%20show%20a%20library%20of%20images%20and%20some%20text.%26nbsp%3B%20Upon%20clicking%20the%20thumbnail%2C%20I%20want%20the%20image%20to%20download%2C%20as%20opposed%20to%20open%20in%20a%20new%20tab%20or%20open%20the%20image%20in%20the%20library.%3C%2FP%3E%3CP%3ESo%20I%20changed%20the%20script%20from%3A%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22tag%22%3E%3CDIV%3E%3C%2FDIV%3E%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Eclass%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22zoom-pictureOnTopImageContainer%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Eid%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22_%23%3D%20pictureContainerId%20%3D%23_%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22tag%22%3E%26gt%3B%3C%2FSPAN%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CSPAN%20class%3D%22tag%22%3E%3CA%3E%3C%2FA%3E%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Eclass%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22cbs-pictureImgLink%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Ehref%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22_%23%3D%20linkURL%20%3D%23_%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Etitle%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22_%23%3D%20%24htmlEncode(line1)%20%3D%23_%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Eid%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22_%23%3D%20pictureLinkId%20%3D%23_%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22tag%22%3E%26gt%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E_%23%3D%20pictureMarkup%20%3D%23_%20%20%20%20%20%20%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3ETo%3A%3C%2FP%3E%3CPRE%3E%3CSPAN%20class%3D%22tag%22%3E%3CA%3E%3C%2FA%3E%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Eclass%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22cbs-pictureImgLink%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Ehref%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22_%23%3D%20linkURL%20%3D%23_%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Etitle%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22_%23%3D%20%24htmlEncode(line1)%20%3D%23_%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Eid%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22_%23%3D%20pictureLinkId%20%3D%23_%22%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22atn%22%3Edownload%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22_%23%3D%20pictureURL%20%3D%23_%22%3C%2FSPAN%3E%3CSPAN%20class%3D%22tag%22%3E%26gt%3B%3C%2FSPAN%3E%3CSPAN%20class%3D%22pln%22%3E_%23%3D%20pictureMarkup%20%3D%23_%3C%2FSPAN%3E%3C%2FPRE%3E%3CP%3ESo%20I%20added%20%3CSTRONG%3E%3CSPAN%20class%3D%22atn%22%3Edownload%3C%2FSPAN%3E%3CSPAN%20class%3D%22pun%22%3E%3D%3C%2FSPAN%3E%3CSPAN%20class%3D%22atv%22%3E%22_%23%3D%20pictureURL%20%3D%23_%22%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3Ewhich%20I%20thought%20would%20mean%20the%20image%20would%20download%20and%20the%20name%20would%20be%20the%20picture%20URL.%3C%2FP%3E%3CP%3EIt%20works%20great%20for%20me%20and%20I%20was%20very%20happy.%20So%20I%20published%20my%20new%20display%20template%20and%20now%20my%20users%20just%20get%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3ESomething%20Went%20Wrong%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ewhere%20the%20display%20template%20should%20be.%3C%2FP%3E%3CP%3EIf%20I%20take%20the%20download%20part%20out%2C%20the%20template%20works%20again%20for%20my%20users.%20I%20could%20understand%20if%20it%20didn't%20work%20at%20all%2C%20but%20as%20an%20administrator%2C%20it%20works%20for%20me%2C%20just%20not%20my%20users%20-%20very%20strange.%3C%2FP%3E%3CP%3ETo%20add%2C%20just%20in%20case%20it's%20not%20obvious%20%3A)%3C%2Fimg%3E%20I'm%20still%20a%20newbie%20with%20SharePoint%2C%20but%20have%20HTML%20experience%26nbsp%3B%20and%20it's%20driving%20me%20insane%20trying%20to%20work%20it%20out%20what%20the%20problem%20is%2C%20so%20please%20help%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1459925%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2013%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

I'm working in SharePoint 2013 and I've customised a display template to show a library of images and some text.  Upon clicking the thumbnail, I want the image to download, as opposed to open in a new tab or open the image in the library.

So I changed the script from:

<div class="zoom-pictureOnTopImageContainer" id="_#= pictureContainerId =#_">
            <a class="cbs-pictureImgLink" href="_#= linkURL =#_" title="_#= $htmlEncode(line1) =#_" id="_#= pictureLinkId =#_">_#= pictureMarkup =#_      

To:

<a class="cbs-pictureImgLink" href="_#= linkURL =#_" title="_#= $htmlEncode(line1) =#_" id="_#= pictureLinkId =#_" download="_#= pictureURL =#_">_#= pictureMarkup =#_

So I added download="_#= pictureURL =#_" which I thought would mean the image would download and the name would be the picture URL.

It works great for me and I was very happy. So I published my new display template and now my users just get Something Went Wrong where the display template should be.

If I take the download part out, the template works again for my users. I could understand if it didn't work at all, but as an administrator, it works for me, just not my users - very strange.

To add, just in case it's not obvious :) I'm still a newbie with SharePoint, but have HTML experience  and it's driving me insane trying to work it out what the problem is, so please help

0 Replies