+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Exclude content from Search Index

Exclude content from Search Index

6 posts, 0 answered
  1. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    30 Oct 2011
    Link to this post
    Ad you could in 3.x versions, how do you exclude content from search such as footer information?
  2. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    02 Nov 2011
    Link to this post
    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
  3. Laura
    Laura avatar
    311 posts
    Registered:
    25 Feb 2008
    02 Nov 2011
    Link to this post
    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.

  4. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    03 Nov 2011
    Link to this post
    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
  5. Saeed
    Saeed avatar
    14 posts
    Registered:
    21 Jun 2011
    25 Nov 2011
    Link to this post
    Thanks Lubomir,

    Helpful info :)
  6. Suranga
    Suranga avatar
    12 posts
    Registered:
    22 Mar 2010
    31 Oct 2012
    Link to this post
    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>
    <%}%>

6 posts, 0 answered