All you need to do is browse to the http://localhost/searc.aspx page and XSLTsearch will work with its default settings. Customize the appearance and what is searched with the various macro parameters as described in the PDF documentation.
it work a error "Cannot find ContentPlaceHolder 'RunwayMasterContentPlaceHolder' in the master
page '/umbraco/masterpages/default.master', verify content control's
ContentPlaceHolderID attribute in the content page."
Ah. The error is caused because you don't have Runway installed.
Open the XSLTsearch template in the umbraco admin interface. On the third line you'll see an <asp:Content ....> tag. The ContentPlaceHolderID= parameter needs to be updated to match a placeholder that your site has. Right now it is looking for a Runway-specific placeholder that you don't have.
The easy way to get the right placeholder id is to position cursor on the empty line 2 and click the toolbar icon that looks like an empty box (near the right-hand side of the toolbar). This will bring up a dialog box with a dropdown list of all the placeholder id's that are valid. Probably you will only have one. Select the appropriate placeholder id.
You will now have an empty <asp:Content ...> </asp:Content> tag with the correct placeholder id. You'll also have your original <asp:Content ...> tag below it.
Leave the first/correct opening <asp:Content ...> tag and then delete the comment, closing </asp:Content> tag, and the original/incorrect <asp:Content ...> tag.
That should do it!
If you have more questions about template please feel free to ask in the template section of the forum. I hope you enjoy XSLTsearch!
I had the same error, followed your instructions, error went away. New error: "Error parsing XSLT file: \xslt\XSLTsearch.xslt". Nothing further. Any ideas? Seen this one? This is a new installation. Perhaps there is a conflict?
The problem is most likely because the /app_code/xsltsearch.cs file is either:
A) missing
B) can't be read by the application pool identity
If missing, you can either re-install the XSLTsearch package, or open the xsltesarch package zip file manually and copy the xsltsearch.cs file to the site's /app_code folder.
If the .cs file is there then you'll want to double-check the file permissions on the file and app_code folder to be sure that the site's application pool identity can read the .cs file.
The last option of what might go wrong is that the site's application pool identity can't create, read, update, and delete from the ASP.NET temporary folder, which is where the compiled version of the .cs file will get put. You'll want to double-check the file permissions on the asp.net temporary folder, which will typically be located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files. (or whatever version of .net your site is running if not v2.0.xxxx).
Well, the *.cs file was not in fact there in /App_Code for whatever reason. I added it there from teh original package. Permissions are correct. Here is the error I am getting now:
By the way, assumign we get this error fixed, I have CWS installed and I'd like to replace that search with XSLT search since it's more powerful. How would I go about that?
Once you have XSLTsearch running on the /search.aspx page you'll only need to change the <form action="/search.aspx" ...> tag in the template to send search queries to the XSLTsearch page instead of the builtin cws search page.
You don't want to put the full XSLTsearch macro on the your master template. You only want the macro on the search page itself (typically the /search.aspx page)
In the html markup of your banner, that's where you would manually code the <form> tag and create the search text box, something like the below. Or keep the original html markup from the cws site and only change the action="" parameter in the form tag and be sure the name of the intput box is "search" as that's the parameter XSLTsearch will be looking for.
Huh, ok. I've now performed those changes and this is the exception I'm getting in my event log:
Cannot find ContentPlaceHolder 'RunwayMasterContentPlaceHolder' in the master page '/umbraco/masterpages/default.master'
I don't have Runway as it is actually no longer offered during the Umbracio install, so I know this is why I am getting the error; trouble is that I'm not sure what to replace this reference with. Truthfully, I don't have a very good understanding of what ContentPlaceHolders are. For example, if I remove this one:
I really appreciate your attention on this Doug -- followed your instructions on the blog post but I'm still getting the same error:
Cannot find ContentPlaceHolder 'RunwayMasterContentPlaceHolder' in the master page '/umbraco/masterpages/default.master', verify content control's ContentPlaceHolderID attribute in the content page.
Do I simply add this ContentPlaceHolder on default.master? I don't think I should have to edit a core template, should I?
However, I can't help but notice that this template has an alias of CWS_Search, which seems suspect. Seems like I should be changing either the alias of this template to "search," OR changing the action on the form tag to CWS_Search.aspx, no? I think your directions are for people who didn't already change out the form action....
Got it working by changing the template alias -- however I am using the Razor sitemap macro on my Master template and although it works / looks great on every other template I am getting a Macro Engine error on the search results page ("Error loading MacroEngine script (file: )". Does this indicate some sort of conflict?
<umbraco:Macro runat="server" language="cshtml"> @inherits umbraco.MacroEngines.DynamicNodeContext @helper traverse(dynamic node) { var maxLevelForSitemap = String.IsNullOrEmpty(Parameter.MaxLevelForSitemap) ? 3 : int.Parse(Parameter.MaxLevelForSitemap); var values = new Dictionary<string,object>(); values.Add("maxLevelForSitemap", maxLevelForSitemap); @* var items = node.Children.Where("Visible").Where("Level <= maxLevelForSitemap", values); *@ var items = node.Children.Where("Level <= maxLevelForSitemap", values); var classextender = ""; if (items.Count() > 0) { <ul id="sitemap"> @foreach (var item in items) { if (@Model.AncestorOrSelf(2).Id == @item.Id) { classextender = "current"; } <li> <a class="@classextender" href="@item.Url">@item.Name</a> @traverse(item) </li> } </ul> } } <div class="sitemap"> @traverse(@Model.AncestorOrSelf()) </div> </umbraco:Macro>
Nothing jumps out at me here so I thought I'd float it past the Umbraco guru.
Something is out of sync here somewhere with all our gyrations and attempts, with a mix of the original exame search and xsltsearch. Any chance you would give me an admin login to your site and I can probably fix it up in much less time than guessing about the situation. I'm pretty sure it's just a few tidbits here and there that aren't lining up rather than something serious. But seeing it first hand would be helpful.
I got it fixed, Doug. All I need to do was to change the Search (only called with template alias) alias to search! Also, I ditched the Razor sitemap because it was too difficult to treat the different levels of navigation differently. Thanks again for all your repsonses on this -- I'm sure we'll talk again soon!
I know it's been a frustrating and sometimes confusing journey but I hope that some things have become clearer -- how macros work, how templates work, etc. and so not completely wasted.
Not in the slightest, Mr. Robar. This is my third Umbraco implementation but the last one was over a year ago so I'm a little rusty ;) Hey -- any ideas on how you would approach a customizable Sidebar? Something where you've got a Document Type called SidebarElement, for example, and you would associate these with many pages on an individual basis? Maybe create a datatype using an xPath CheckBoxList to select the elements and then you would check the boxes on each page for which ones you want to show up? And then the XSLT macro would use Relations / GetRelatedNodesAsXml() to show them?
The only thing I've find with a similar goal in mind uses a usercontrol and I'm not sure I'm ready for / have time for that.
There are a couple ways to do what you want (a few packages as well). But this is outside the scope of the original post and where it should be made (the question isn't about an XSLTsearch bug). Do post it again in the proper place and you'll get more people seeing it and offering suggestions.
How to reference XSLTsearch in my page
I can correctly installed the XSLTsearch,But I don't know How to reference XSLTsearch in my page,Who can give me a simple example?thank you very much
All you need to do is browse to the http://localhost/searc.aspx page and XSLTsearch will work with its default settings. Customize the appearance and what is searched with the various macro parameters as described in the PDF documentation.
cheers,
doug.
Thanks Doug,
when I am browse to the http://localhost/search.aspx page,
it work a error "Cannot find ContentPlaceHolder 'RunwayMasterContentPlaceHolder' in the master page '/umbraco/masterpages/default.master', verify content control's ContentPlaceHolderID attribute in the content page."
Ah. The error is caused because you don't have Runway installed.
Open the XSLTsearch template in the umbraco admin interface. On the third line you'll see an <asp:Content ....> tag. The ContentPlaceHolderID= parameter needs to be updated to match a placeholder that your site has. Right now it is looking for a Runway-specific placeholder that you don't have.
The easy way to get the right placeholder id is to position cursor on the empty line 2 and click the toolbar icon that looks like an empty box (near the right-hand side of the toolbar). This will bring up a dialog box with a dropdown list of all the placeholder id's that are valid. Probably you will only have one. Select the appropriate placeholder id.
You will now have an empty <asp:Content ...> </asp:Content> tag with the correct placeholder id. You'll also have your original <asp:Content ...> tag below it.
Leave the first/correct opening <asp:Content ...> tag and then delete the comment, closing </asp:Content> tag, and the original/incorrect <asp:Content ...> tag.
That should do it!
If you have more questions about template please feel free to ask in the template section of the forum. I hope you enjoy XSLTsearch!
cheers,
doug.
Thanks Doug,
I think I can do it
Hi Doug--
I had the same error, followed your instructions, error went away. New error: "Error parsing XSLT file: \xslt\XSLTsearch.xslt". Nothing further. Any ideas? Seen this one? This is a new installation. Perhaps there is a conflict?
Thanks,
Garrett
When I try to save the XSLTSearch XSLT file in the UI I get:
Error occured
System.Xml.Xsl.XslTransformException: Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'. at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) at startTime(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
Hi, Garrett,
The problem is most likely because the /app_code/xsltsearch.cs file is either:
A) missing
B) can't be read by the application pool identity
If missing, you can either re-install the XSLTsearch package, or open the xsltesarch package zip file manually and copy the xsltsearch.cs file to the site's /app_code folder.
If the .cs file is there then you'll want to double-check the file permissions on the file and app_code folder to be sure that the site's application pool identity can read the .cs file.
The last option of what might go wrong is that the site's application pool identity can't create, read, update, and delete from the ASP.NET temporary folder, which is where the compiled version of the .cs file will get put. You'll want to double-check the file permissions on the asp.net temporary folder, which will typically be located at C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files. (or whatever version of .net your site is running if not v2.0.xxxx).
Let us know how you get on.
cheers,
doug.
Well, the *.cs file was not in fact there in /App_Code for whatever reason. I added it there from teh original package. Permissions are correct. Here is the error I am getting now:
http://31.222.157.191/search.aspx
By the way, assumign we get this error fixed, I have CWS installed and I'd like to replace that search with XSLT search since it's more powerful. How would I go about that?
Thanks,
Garrett
Once you have XSLTsearch running on the /search.aspx page you'll only need to change the <form action="/search.aspx" ...> tag in the template to send search queries to the XSLTsearch page instead of the builtin cws search page.
cheers,
doug.
Thanks again Doug. I've placed the following code into my Master template:
And it doesn't create a form tag so the (non-)form doesn't submit. Here is the HTML the Macro puts out:
That's it. Where's the form? What am I doing wrong here?
Thanks,
Garrett
Hi, Garrett,
You don't want to put the full XSLTsearch macro on the your master template. You only want the macro on the search page itself (typically the /search.aspx page)
In the html markup of your banner, that's where you would manually code the <form> tag and create the search text box, something like the below. Or keep the original html markup from the cws site and only change the action="" parameter in the form tag and be sure the name of the intput box is "search" as that's the parameter XSLTsearch will be looking for.
<form action="/search.aspx"><input name="search" type="text" /><input type="submit" value="Search"/></form>
cheers,
doug.
Huh, ok. I've now performed those changes and this is the exception I'm getting in my event log:
I don't have Runway as it is actually no longer offered during the Umbracio install, so I know this is why I am getting the error; trouble is that I'm not sure what to replace this reference with. Truthfully, I don't have a very good understanding of what ContentPlaceHolders are. For example, if I remove this one:
My whole site breaks -- and I don't even know what the "headerLinks" even are.
Thanks again,
Garrett
Hi, Garrett,
I figured the easiest way to explain this was make a blog post. Check it out. You should be going in no time.
http://blog.percipientstudios.com/2012/7/23/using-xsltsearch-with-cws.aspx
cheers,
doug.
I really appreciate your attention on this Doug -- followed your instructions on the blog post but I'm still getting the same error:
Do I simply add this ContentPlaceHolder on default.master? I don't think I should have to edit a core template, should I?
Actually, now that i have deleted the XSLT template, the search page in the Content seciton, and the XSLT doctype as indicated, I amsimply getting:
An error occurred while processing your request.
And nothing in the log, unfortunately. Here is my Search (only called with template alias) template:
However, I can't help but notice that this template has an alias of CWS_Search, which seems suspect. Seems like I should be changing either the alias of this template to "search," OR changing the action on the form tag to CWS_Search.aspx, no? I think your directions are for people who didn't already change out the form action....
A very sincere thanks once again,
Garrett
Got it working by changing the template alias -- however I am using the Razor sitemap macro on my Master template and although it works / looks great on every other template I am getting a Macro Engine error on the search results page ("Error loading MacroEngine script (file: )". Does this indicate some sort of conflict?
Nothing jumps out at me here so I thought I'd float it past the Umbraco guru.
//Garrett
Hi, Garrett,
Something is out of sync here somewhere with all our gyrations and attempts, with a mix of the original exame search and xsltsearch. Any chance you would give me an admin login to your site and I can probably fix it up in much less time than guessing about the situation. I'm pretty sure it's just a few tidbits here and there that aren't lining up rather than something serious. But seeing it first hand would be helpful.
Rather than posting the login info on the forum, can you drop me a note through my website at http://www.percipientstudios.com/about/contact.aspx
cheers,
doug.
I got it fixed, Doug. All I need to do was to change the Search (only called with template alias) alias to search! Also, I ditched the Razor sitemap because it was too difficult to treat the different levels of navigation differently. Thanks again for all your repsonses on this -- I'm sure we'll talk again soon!
//Garrett
Congratulations and well done!!
I know it's been a frustrating and sometimes confusing journey but I hope that some things have become clearer -- how macros work, how templates work, etc. and so not completely wasted.
cheers,
doug.
Not in the slightest, Mr. Robar. This is my third Umbraco implementation but the last one was over a year ago so I'm a little rusty ;) Hey -- any ideas on how you would approach a customizable Sidebar? Something where you've got a Document Type called SidebarElement, for example, and you would associate these with many pages on an individual basis? Maybe create a datatype using an xPath CheckBoxList to select the elements and then you would check the boxes on each page for which ones you want to show up? And then the XSLT macro would use Relations / GetRelatedNodesAsXml() to show them?
The only thing I've find with a similar goal in mind uses a usercontrol and I'm not sure I'm ready for / have time for that.
Thoughts?
//Garrett
Excellent!
There are a couple ways to do what you want (a few packages as well). But this is outside the scope of the original post and where it should be made (the question isn't about an XSLTsearch bug). Do post it again in the proper place and you'll get more people seeing it and offering suggestions.
cheers,
doug.
is working on a reply...