How to implement Searchblox search results within iFrame?

You can implement search within an iFrame by customizing the xsl template by adding target="_top" to the search result link output:

<a href="{url}" target="_top">
    <xsl:apply-templates select="title" />
</a>
 
 

Then modify javascript in the client.js file as below for featured results:

renderTextAd: function(ad, adElement, url) {
var titleContainer = document.createElement("div");
adElement.appendChild(titleContainer);

var titleElement = document.createElement("a");
titleElement.className = "title";
titleElement.href = url;
titleElement.target = "_top";
titleElement.innerHTML = ad.title;
titleContainer.appendChild(titleElement);

var descrElement = document.createElement("div");
descrElement.className = "description";
descrElement.innerHTML = ad.description;
adElement.appendChild(descrElement);
},

 

 
Have more questions? Submit a request

Comments