Forum for discussing general topics related to Couch.
5 posts Page 1 of 1
Hi,

I read the docs regarding search and displaying search results and everything is well documented excepting one particular case: when a custom form is used and the search results will be displayed in search.php
All I see is:

To make the search_form tag invoke search.php (instead of index.php) upon form submssion, its processor parameter can be set in the following manner -
<cms:search_form msg='Enter keywords' processor="<cms:show k_site_link/>search.php"/>


But what happens if custom form is used?

Thanks,
Attila
Hi Attila,

That actually is mentioned in the documentation. I quote from http://www.couchcms.com/docs/concepts/using-search.html
You can create and use your own form instead of using the one created by search_form tag. Just make sure that the textbox, within which the keywords will be inputted by the users, is named 's'.

Hope this helps.
Hi KK,

I get that part, it's ok. But if not using search_form how do I invoke search.php from my custom form? This was the real question.
Thank you.

Attila
Hi Attila,
how do I invoke search.php from my custom form?

The regular 'action' parameter of the form can be used to indicate that 'search.php' is to be invoked on form submission. For example, as follows -
Code: Select all
<form method="get" action="http://www.yourdomain.com/search.php" >
     <input type="text" value="" name="s" />
     <input type="submit" value="Go"/> 
</form>

If you prefer, you may use cms:form tag to generate the form -
Code: Select all
<cms:form method="get" action="<cms:link 'search.php' />" anchor='0'>
     <cms:input type="text" value="" name="s" />
     <cms:input type="submit" value="Go" name='submit' /> 
</cms:form>

Does this help?
Please let me know.
Yes KK, it's perfect! Thank you. I will finish soon the website I'm working on and I'm going to buy a PRO COUCH license :)

Attila
5 posts Page 1 of 1