Is it possible to execute an XSLT search macro from flash? I'm using CWS. I want to be able to design a form in flash with a search button that executes a search as the Search Macro with CWS does.
You simply want to be sure that your flash calls the page with the XSLTsearch macro on it (/search.aspx, by default), and that flash sends a querystring or form field called 'search' that contains the text you want searched. The form method can be either post or get.
depending on what level of action script you are using you could call a javascript function embeded in the template to call the search.aspx page as well...
as3 usese the call externalInterace() function to access javascript on the embedding page...
or you can just use the navigateToUrl() and pass the conent of the search texfield as querystring
are you going to parse the returned xml in flash? if so, i would LOVE to see this implementation :) - if only i had more time, i would love to make something like this as a widget that could be embedded all over the place... man, that woudl be awesome... oh, for more time.
The results page is going to be in html, just had my designers insist that the text you enter in the search box, which is in the middle of a motion graphic, be in a specific font ;)
Your idea is actually interesting. I could see it being the beginning of a framework to use Umbraco as a CMS for Flash sites.
I have used javascript/jQuery to communicate with flash. As Bob is suggesting, setting up functions on the embedding page that are called from flash is a nice way to interact!
I've installed Runway XSLTsearch package, the search.aspx page is working great. When i put the form above on my homepage, type in a search term and press enter, all i get is a ? after the url, no interaction with the search page. When I place the XSLTsearch macro on the homepage it works great. Any ideas what I'm doing wrong?
XSLTsearch 2.8 will work with either POST or GET methods (earlier verisons only used GET).
I suspect that your html page has two form tags on it, or that the enter keystroke is being consumed by another form and therefore isn't sending the action to the search.aspx page. Just using action="?" will only work if you are on the search.aspx page already or you have a way of handling postbacks. XSLTsearch is simpler than that so you want to set the action to the search.aspx page specifically.
I've kind of lost track of your page and it's problems. Can you summarize what is in your html (especially if there are two form tags), and what does and doesn't happen when you enter text in the form and click the submit button?
There is another form on my page, which is used to call the template (see below), at this point, I'm just trying to get an html form to work on the page, once i have that i figure Flash will be easy.
So, to summarize i have this form and the form above, whose action is my search.aspx page. What happens when i click submit or press enter is that it just posts a ? to the end of the url.
Ahh... that's what I thought might be happening. You've got a <form runat="server" .... > tag in your masterpage template, and that's "eating" the form submission for the search.
It may be that you've put the search's form inside the aspnetForm? That's not going to work. You can't have one form tag inside another. This can happen unwittingly when your master template has the aspnet form and the child template includes the <form> tag directly. The result can be seen when you view the html source of the rendered page in the browser.
Assuming you have Runway installed, you would want your master template to look like this:
Sure. I often do that myself and add the <form runat="server" ... > tags around those individual items that need it. Others like to encapsulate the entire page in a form at the top template. Each approach has pros and cons but the key thing is to make your templates so they work.
Execute XSLT Search from Flash Form.
Hi,
Is it possible to execute an XSLT search macro from flash? I'm using CWS. I want to be able to design a form in flash with a search button that executes a search as the Search Macro with CWS does.
Thank you,
Amir
No problem at all.
You simply want to be sure that your flash calls the page with the XSLTsearch macro on it (/search.aspx, by default), and that flash sends a querystring or form field called 'search' that contains the text you want searched. The form method can be either post or get.
In plain HTML, it would be:
cheers,
doug.
depending on what level of action script you are using you could call a javascript function embeded in the template to call the search.aspx page as well...
as3 usese the call externalInterace() function to access javascript on the embedding page...
or you can just use the navigateToUrl() and pass the conent of the search texfield as querystring
are you going to parse the returned xml in flash? if so, i would LOVE to see this implementation :) - if only i had more time, i would love to make something like this as a widget that could be embedded all over the place... man, that woudl be awesome... oh, for more time.
Bob,
The results page is going to be in html, just had my designers insist that the text you enter in the search box, which is in the middle of a motion graphic, be in a specific font ;)
Your idea is actually interesting. I could see it being the beginning of a framework to use Umbraco as a CMS for Flash sites.
-AK
I have used javascript/jQuery to communicate with flash. As Bob is suggesting, setting up functions on the embedding page that are called from flash is a nice way to interact!
/Thomas Kahn
I've installed Runway XSLTsearch package, the search.aspx page is working great. When i put the form above on my homepage, type in a search term and press enter, all i get is a ? after the url, no interaction with the search page. When I place the XSLTsearch macro on the homepage it works great. Any ideas what I'm doing wrong?
here's the code i'm using for the html form:
Thank you,
Amir
Try method="get" on your form, also in the xsltsearch file,
changing
to
should have the same effect on the search page
Still nothin. I also tried the following:
XSLTsearch 2.8 will work with either POST or GET methods (earlier verisons only used GET).
I suspect that your html page has two form tags on it, or that the enter keystroke is being consumed by another form and therefore isn't sending the action to the search.aspx page. Just using action="?" will only work if you are on the search.aspx page already or you have a way of handling postbacks. XSLTsearch is simpler than that so you want to set the action to the search.aspx page specifically.
I've kind of lost track of your page and it's problems. Can you summarize what is in your html (especially if there are two form tags), and what does and doesn't happen when you enter text in the form and click the submit button?
cheers,
doug.
Doug,
I appreciate your time with this.
There is another form on my page, which is used to call the template (see below), at this point, I'm just trying to get an html form to work on the page, once i have that i figure Flash will be easy.
So, to summarize i have this form and the form above, whose action is my search.aspx page. What happens when i click submit or press enter is that it just posts a ? to the end of the url.
Thanks again,
Amir
Ahh... that's what I thought might be happening. You've got a <form runat="server" .... > tag in your masterpage template, and that's "eating" the form submission for the search.
It may be that you've put the search's form inside the aspnetForm? That's not going to work. You can't have one form tag inside another. This can happen unwittingly when your master template has the aspnet form and the child template includes the <form> tag directly. The result can be seen when you view the html source of the rendered page in the browser.
Assuming you have Runway installed, you would want your master template to look like this:
cheers,
doug.
I see now! So there is no way to have form fields inside of one of my subtemplates?
Doug, I just deleted the form tags surrounding the content placeholder and it works fine? Is that normal behavior?
Sure. I often do that myself and add the <form runat="server" ... > tags around those individual items that need it. Others like to encapsulate the entire page in a form at the top template. Each approach has pros and cons but the key thing is to make your templates so they work.
Glad you got it going.
cheers,
doug.
This ended up working for me, thank you all for your help.
-AK
is working on a reply...