I need to set up my search bar... Options
Ewatkins
Posted: Tuesday, November 25, 2008 3:58:59 PM
Rank: Aficionado

Joined: 10/8/2008
Posts: 106
Location: Virginia
I have xsltSearch that came with umbraco, how can I use it with my text box I have created in my page to use it to search? Can someone please give me a quick play by play on it.

Thanks
Evan
drobar
Posted: Tuesday, November 25, 2008 4:07:26 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Ewatkins
Posted: Tuesday, November 25, 2008 7:20:47 PM
Rank: Aficionado

Joined: 10/8/2008
Posts: 106
Location: Virginia
OK so far I have done the following:
Created a search.aspx and have it using the template containing this macro:
<umbraco:Macro source="" searchFields="all" previewFields="all" searchBoxLocation="NONE" previewType="Beginning" resultsPerPage="5" previewChars="20" showPageRange="50" showOrdinals="1" showScores="0" showStats="0" Alias="XSLTSearch" runat="server"></umbraco:Macro>

I have also created this form in my master page:
<form name="searchForm" id="searchForm" action="/search.aspx" method="POST">
<asp:TextBox ID="searchID" name="search" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Search" />
</form>

When I search for anything in the bar and hit submit nothing happens. What am I missing?
drobar
Posted: Tuesday, November 25, 2008 7:33:26 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
The "all" value for searchFields and previewFields is not valid (unless you've got a document type property with an alias of 'all', which I don't suppose you do).

Try this for your macro to get started. You can always move away from the default settings according to the full PDF documentation for XSLTsearch (available on my website and in the package repository).

Code:
<umbraco:Macro source=""
searchFields=""
previewFields=""
searchBoxLocation=""
previewType=""
resultsPerPage=""
previewChars=""
showPageRange=""
showOrdinals=""
showScores=""
showStats=""
Alias="XSLTSearch"
runat="server">
</umbraco:Macro>


This will use all the default values for XSLTsearch which should be enough to get you started.

Then, go to the /search.aspx page and enter a search term. Does it work? If not, check that you don't have the XSLTsearch's <form> tag appearing inside an <?ASPNET_FORM> tag (you can't have a form inside a form in HTML). This is described in the troubleshooting section of the XSLTsearch docs.

If the search.aspx pages does work but your search bar doesn't, check that you've got a <form action="/search.aspx"...> tag and that the search textfield has a name="search".

Any other problems, please give as much detail as possible.

cheers,
doug.


MVP 2007-2009 - Percipient Studios
Ewatkins
Posted: Tuesday, November 25, 2008 7:54:25 PM
Rank: Aficionado

Joined: 10/8/2008
Posts: 106
Location: Virginia
Alright I got that in and when I go to search.aspx I have the search bar and it works if I use it, now how do I move that search bar and have it somewhere else on my page? I want the search bar to be in the master page so it can be searched everywhere. The master page search that I have in right now (that does not work) is this:
<form name="searchForm" id="searchForm" action="/search.aspx" method="POST">
<asp:TextBox ID="searchID" name="search" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Search" />
</form>

that does not work at all, it doesn't bring up the search.aspx page or anything.


All I want is the search bar to be in the right side on my page in the master page and when it is searched the results show up on the left side of the page, where the content normally is.

Thanks so much
Ewatkins
Posted: Tuesday, November 25, 2008 9:48:37 PM
Rank: Aficionado

Joined: 10/8/2008
Posts: 106
Location: Virginia
when I search for anything, using the get method, this is what comes up in my address bar..
http://www.mysite.com/default.aspx?__VIEWSTATE=%2FwEPDwUENTM4MWRk63nN0rwBc7XAm7RiLdP8u3UDu%2Fg%3D&search=search&ctl00%24ctl00%24ctl00%24ContentPlaceHolderDefault%24Button1=Search

I have no clue why it is defaulting to default.aspx, the code running the form is..
<form name="searchForm" id="searchForm" action="/search.aspx" method="GET" runat="server">
<input type="text" name="search" value="search" size="20"/>

<input type="submit" value="Search">
</form>

if I put in http://www.mysite.com/search.aspx?search=e then the search is fine and shows what is needed, why would it be sending the submit to default.aspx and putting all of that junk behind it?

please help
Ewatkins
Posted: Tuesday, November 25, 2008 9:54:28 PM
Rank: Aficionado

Joined: 10/8/2008
Posts: 106
Location: Virginia
Figured it out, stupid mistake on my part..thanks so much
drobar
Posted: Tuesday, November 25, 2008 10:50:06 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Glad you got it figured out! For the benefit of the next person, could you make a small note about what you needed to do to resolve it?

cheers,
doug.

MVP 2007-2009 - Percipient Studios
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.