Quais são as etapas para adicionar o recurso de pesquisa aberta a um site do ASP.NET MVC existente?

StackOverflow https://stackoverflow.com/questions/1957334

Pergunta

Eu percebo quando vou a alguns sites (inclua Stackoverflow) do Firefox, um pequeno círculo azul mostra que posso adicionar o site aos meus provedores de pesquisa. Então, queria saber como pode adicionar esse recurso ao meu projeto MVC. Eu ouvi um arquivo XML deve ser adicionado ...

Foi útil?

Solução

Follow the instructions in this guide.

This is the meat and veg of it though...

The link in your master page:

<link rel="search" type="application/opensearchdescription+xml" href="http://mysite.com/browserplugin.xml" title="My Site Search" />  

The browserplugin.xml file mentioned above should look like this:

<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>My Site Search</ShortName>
    <Description>My Site Search</Description>
    <Image height="16" width="16" type="image/x-icon">http://mysite.com/favicon.ico</Image>
    <Url type="text/html" method="get" template="http://mysite.com/search/{searchTerms}"/>
</OpenSearchDescription>

Note that you should (obviously) change that urls appropriately according to your website. Specifically the Url in the OpenSearchDescription in order to match your search url.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top