Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi

I'm trying to implement a search form on my blog with the help of the documentation (which helped me soooo much to understand the whole Couch idea, it's really amazing. :-) )

But I don't completely understand the search form way of working.

I have a snippet called 'sidebar.html' which contains this lines of code:

Code: Select all
<sidebar class="col-md-4 sidebar">
         <cms:search_form msg='Enter keywords' processor="<cms:show k_site_link/>search.php"/>
</sidebar>


Than I created a search.php in my root folder and that file contains this code:

Code: Select all
<?php require_once( 'admin/cms.php' ); ?>

<cms:search_form />

<cms:search>
    <cms:if k_paginated_top >
        <div>
            <cms:if k_paginator_required >
                Page <cms:show k_current_page /> of <cms:show k_total_pages /><br>
            </cms:if>
            <cms:show k_total_records /> Pages Found -
            displaying: <cms:show k_record_from />-<cms:show k_record_to />
        </div>
    </cms:if>

    <h3><a style="color:red;" href="<cms:show k_page_link/>"><cms:show k_search_title /></a></h3>
    <cms:show k_search_excerpt />
    <hr>

    <cms:paginator />

</cms:search>
<?php COUCH::invoke(); ?>


I do get a search form in my sidebar, but when I add a keyword (that is certainly in one of the blogposts) I get the result you can see in attachment.

Any idea if I missed some steps here?

Thanks!

Attachments

Hi,

Please try adding the 'limit' parameter and cms:no_results tag to the search block like this -
Code: Select all
<cms:search limit='10'>
    ...
    ...
    ...

    ...

    <cms:no_results>
        <h3>No matching orders found</h3>
    </cms:no_results>
   
</cms:search>   

Does it make any difference?
I'm very sorry, I just found out I was working in a wrong file...
The searchform is working fine!

I read in the documentation that the searchmechanism doesn't account words with less than 4 letters.
Is there absolute no work around?

Because I'm making a blog about cocktailshaking and the users should search at "Rum, Gin,..." 8-)

Thanks
That 4 character limit is actually of MySQL so, I'm afraid, there is little we can do to change that.
4 posts Page 1 of 1