Exclude content from Search Index

Posted by Community Admin on 04-Aug-2018 18:16

Exclude content from Search Index

All Replies

Posted by Community Admin on 30-Oct-2011 00:00

Ad you could in 3.x versions, how do you exclude content from search such as footer information?

Posted by Community Admin on 02-Nov-2011 00:00

Hi Laura,

Well, if your footer is a custom control the easiest way is to add the following code in the Render method of your control:

using System.Web.UI;
 
protected override void Render(HtmlTextWriter writer)
    var indexRenderMode = this.GetIndexRenderMode();
    if (indexRenderMode == IndexRenderModes.Normal)
    
        base.Render(writer);
    

All the best,
Lubomir Velkov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 02-Nov-2011 00:00

I am not sure what you mean.

For another example, on every page we have copy up in the header area such as:

For immediate assistance, call XYZ Company at 1-800-000-000.

Posted by Community Admin on 03-Nov-2011 00:00

Hi Laura,

Is your header area a Content block or user control like an .ascx file? If it isn't an .ascx file you could create one and add the code I pasted to you in my first reply.

Greetings,
Lubomir Velkov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 25-Nov-2011 00:00

Thanks Lubomir,

Helpful info :)

Posted by Community Admin on 31-Oct-2012 00:00

If your header and footer embed (hard coded) to master page, you can use this code block;

<%if (Page.GetIndexRenderMode() == IndexRenderModes.Normal) %>
<header>contents......</header>
<%%>

This thread is closed