Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Conditional Statement to change the icon returned in display template?

$
0
0

Hi,

i am using a display template to retuen list of files in a content web part using the search content query.

I do not like the icons that respresent word, excel etc and i have some really nice ones i would like to use instead.

So, i am thinking, is this the best way?

In my item template, i would create a conditional statement to look at the current item file extension and set the img source?

This is the line that displays the icon for the current file. I want to change it as i don't like it? Any easy/best way?

Thanks.

<a href="_#= linkURL =#_"><img src="_#= $urlHtmlEncodeString(iconURL) =#_" alt="_#= $htmlEncode(line1.defaultValueRenderer(line1)) =#_" id="_#= pictureId =#_"  /></a>


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>