Search "Static HTML in Pages" highlighting content outside of content blocks. - General Discussions - General Discussions - Progress Community

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

 General Discussions

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

  • Search "Static HTML in Pages" highlighting content outside of content blocks.
  • 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

  • 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
     
  • Thank you Stanislav. I will give that a try.