ResultIllustrated widget, imported way to display title from
SubClassResult widget
elm.find('.doc:last .icon').append('<object data="images/icons/'+ extension.toLowerCase() +'-icon-24x24.png"><img src="images/icons/default-icon-24x24.png" /></object>&nbsp;');
var urlRedirect = 'URL?url='+ url + '&id='+Manager.store.get("id").value + '&q=' + Manager.store.get("q").value + '&position='+position;
+ var title;
+ // if the document is an html file, get the extracted title metadata
+ if (doc.extension == "html"){
+ title = doc.title;
+ // for other files, get the filename from the url
+ } else{
+ title = doc.url.split('/');
+ title = title[title.length-1];
+ }
elm.find('.doc:last .res').append('<a class="title" target="_blank" href="'+urlRedirect+'"></a>');
- elm.find('.doc:last .title').append('<span>' +decodeURIComponent(doc.title) + '</span>');
+ elm.find('.doc:last .title').append('<span>' +decodeURIComponent(title) + '</span>');
elm.find('.doc:last .res').append('<p class="description"></p>');
elm.find('.doc:last .description').append('<div id="snippet">'+ description+ '</div>');
elm.find('.doc:last .description').append('<div id="urlMobile"><p class="address"></p></div>');
