I've downloaded the zip file and installed it through the Developer/Install local package route and Simple Search is now listed in the list of installed packages but nowhere else. What else do I need to do to get the search box on the page and get it searching?
In principle it installes only the necessary things like the dll and an example config. You have to edit the config file and then set up an xslt or usercontrol which does the search. Please take a look into the documentation (see the project page under the documentation tab or direct: http://our.umbraco.org/FileDownload?id=138)
Think this will explain your questions, if not come back here and post your question details.
Thanks for coming back so swiftly. I followed the example in the document and all the files seemed to be in the right places but when I created the XSLT with the example code no macro was created even though the "create macro" box was ticked, so I am currently stuck at that point.
I'm also not sure by what you mean in the example documentation when you say "Add a Search site to your content and add the macro which you created with the xslt..." Add a Search site, I've been looking for a macro to include on a page. What does "site" mean in this context?
Hi! And what about if I want to implement this search module with simple text pages. I try to follow you example with Blog Search as you describe in documentation. And get an error.
But the i think i am confused about linktosearchpage format. i tried many different formats but it always gives me "the page could not be found". should it be sth like /tcbase/teacommerce/SubmitForm.aspx or sth like{umbraco.library:NiceUrl($category/@id)}
The LINKTOSEARCHPAGE should be the url of the page with the search macro in it. So if you have a page "search" under your root it woud be "/search/". How this url is generated is your decision. I.e if you have a defined search page you can use
{umbraco.library:NiceUrl(1234)}
where 1234 is the id of your search page or you can link via hardcoded url like "htttp://www.yourdomain.com/search/"
Installation procedure
I've downloaded the zip file and installed it through the Developer/Install local package route and Simple Search is now listed in the list of installed packages but nowhere else. What else do I need to do to get the search box on the page and get it searching?
Thanks
Andrew
In principle it installes only the necessary things like the dll and an example config. You have to edit the config file and then set up an xslt or usercontrol which does the search. Please take a look into the documentation (see the project page under the documentation tab or direct: http://our.umbraco.org/FileDownload?id=138)
Think this will explain your questions, if not come back here and post your question details.
hth, Thomas
Thomas,
Thanks for coming back so swiftly. I followed the example in the document and all the files seemed to be in the right places but when I created the XSLT with the example code no macro was created even though the "create macro" box was ticked, so I am currently stuck at that point.
I'm also not sure by what you mean in the example documentation when you say "Add a Search site to your content and add the macro which you created with the xslt..." Add a Search site, I've been looking for a macro to include on a page. What does "site" mean in this context?
Any help would be gratefully received.
Cheers
Andrew
Hi Andrew,
if you got no macro just create a new one:
In the end I plumped for XSLT Search
Gus
Hi! And what about if I want to implement this search module with simple text pages. I try to follow you example with Blog Search as you describe in documentation. And get an error.
I have this markup:
<form id="header-search" method="get" action="/1280.aspx">
<ul>
<li>
<label for="main-search" class="viewport-bounce">:</label>
<input type="text" name="main-search" id="main-search" placeholder="" />
</li>
<li>
<input type="submit" id="main-search-submit" value="" />
</li>
<li><a href="#" id="close-main-search">
<img src="/images/search-close.png" alt="Close" /></a>
</li>
</ul>
<div class="suggestionsBoxHeader" id="suggestionsHeader">
<div class="suggestionListHeader" id="autoSuggestionsListHeader">
</div>
</div>
</form>
And this xslt:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon"
xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes"
xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath"
xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions"
xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings"
xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets"
xmlns:ss4u.library="urn:ss4u.library"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon
Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions
Exslt.ExsltStrings Exslt.ExsltSets ss4u.library ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:variable name="phrase" select="umbraco.library:RequestQueryString('main-search')"/>
<xsl:if test="$phrase != ''">
<xsl:variable name="results" select="ss4u.library:SearchToXml($phrase, 0, 'TextSearch')" />
<h2>Results</h2>
<p>Your search for <strong>'<xsl:value-of select="$phrase" />'</strong>returned <strong><xsl:value-of select="count($results/SearchResult)" /></strong>items</p>
<ul>
<xsl:for-each select="$results/SearchResult">
<xsl:sort select="@createDate" order="descending"/>
<li><a href="{@linkUrl}"><xsl:value-of select="@text" /></a></li>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
And this line in SearchPage template:
<umbraco:Macro Alias="SimpleSearch" runat="server"></umbraco:Macro>
This config:
<?xml version="1.0"?>
<SimpleSearch4Umbraco
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SearchDefinition
name="TextSearch"
iterationType="IterateAll"
isDefault="true">
<DocumentType
alias="TextPage"
category="TextPage"
includeChildNodes="false"
testNodeName="true">
<Property
alias="tP_Content"
comparisonType="String"
comparison="Contains" />
<Property
alias="tP_Title"
comparisonType="String"
comparison="Contains" />
</DocumentType>
</SearchDefinition>
</SimpleSearch4Umbraco>
Hi Thomas,
as mention above i have used
But the i think i am confused about linktosearchpage format. i tried many different formats but it always gives me "the page could not be found". should it be sth like /tcbase/teacommerce/SubmitForm.aspx or sth like {umbraco.library:NiceUrl($category/@id)}
thks -
Frmt
The LINKTOSEARCHPAGE should be the url of the page with the search macro in it. So if you have a page "search" under your root it woud be "/search/". How this url is generated is your decision. I.e if you have a defined search page you can use
where 1234 is the id of your search page or you can link via hardcoded url like "htttp://www.yourdomain.com/search/"
hth, Thomas
is working on a reply...