Search "Static HTML in Pages" highlighting content

Posted by Community Admin on 03-Aug-2018 00:56

Search "Static HTML in Pages" highlighting content outside of content blocks.

All Replies

Posted by Community Admin on 24-Dec-2015 00:00

We are on Sitefinity 8.1.

I notice when I search a word, it will properly index and only include pages in the output which have the word in a content block. However, if the word is used elsewhere on the page (not in a content block - in a menu on the master page, etc), it will highlight the items outside of the menu block as well.

For example, if a user searches "permit" on our site, it will only find pages that have "permit" somewhere in a content block, but we have "Apply for a permit", "Search for a permit" in our menu on the master page. The search results will muddle up with "Apply for a permit", "Search for permit" and their surrounding text. Since those menus appear globally, we don't really want them highlighted.

Do I have any options here?

 Thanks,

Jeff

Posted by Community Admin on 28-Dec-2015 00:00

Hello Jeff,

Thank you for contacting us.

The search pickup and highlights all words matching the search terms. If applicable the text on the master page can be hidden from the search engine and not added to the search index.

For this to hide controls html output from the search on master page set the below in the codebehind of the master page.
Reindex the search index and it will not contain the output of the control named MyControl.

protected void Page_Load(object sender, EventArgs e)
     
         if (this.GetIndexRenderMode() == Telerik.Sitefinity.Web.UI.IndexRenderModes.NoOutput)
         
             //hide placeholder or widget form the master page
             this.MyControl.Visible = false;
  
         
     


Regards,
Stanislav Velikov
Telerik
 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

Posted by Community Admin on 28-Dec-2015 00:00

Thank you Stanislav. I will give that a try.

This thread is closed