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

Forums / General Discussions / Search "Static HTML in Pages" highlighting content outside of content blocks.

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

3 posts, 0 answered
  1. Jeff
    Jeff avatar
    15 posts
    Registered:
    13 Mar 2012
    24 Dec 2015
    Link to this post

    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

  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    22 Sep 2016
    28 Dec 2015
    Link to this post
    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
     
  3. Jeff
    Jeff avatar
    15 posts
    Registered:
    13 Mar 2012
    28 Dec 2015
    Link to this post
    Thank you Stanislav. I will give that a try.
3 posts, 0 answered