Hello,
I am trying to implemenet the search function, but I am not able to integrate it to my website.
I have tried the following:
1. Putting the following to my index.php webpage.
1.1
-------------------------------------------------------------
OR
-----------------------------------------------------------------
2. Putting the following to my search.php page:
It simply doesn't find anything
--------------------------------------------
And one more question:
---------------------------------------------
Is there anyway I can integerate a more flexible search functionality (say autocomplete or a search with less than 4 characters):
I am using JQM for my website: It suggests using the following code for remote autocomplete:
Is it possible getting data from the DB via ajax using the above code.
Answering ANY of the above questions would be greatly appreciated.
Best regards,
Art
I am trying to implemenet the search function, but I am not able to integrate it to my website.
I have tried the following:
1. Putting the following to my index.php webpage.
1.1
- 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>
-------------------------------------------------------------
OR
- Code: Select all
1.2 <cms:search_form msg='Enter keywords' processor="<cms:show k_site_link />search.php" />
-----------------------------------------------------------------
2. Putting the following to my search.php page:
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:search limit='10'>
<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 href="<cms:show k_page_link />"><cms:show k_search_title /></a></h3>
<cms:show k_search_excerpt />
<hr>
<cms:paginator />
<cms:no_results>
Search query <pre><p><cms:show k_search_query /></p></pre> produced 0 results.
</cms:no_results>
</cms:search>
<?php COUCH::invoke(); ?>
It simply doesn't find anything
--------------------------------------------
And one more question:
---------------------------------------------
Is there anyway I can integerate a more flexible search functionality (say autocomplete or a search with less than 4 characters):
I am using JQM for my website: It suggests using the following code for remote autocomplete:
- Code: Select all
$( document ).on( "pagecreate", "#myPage", function() {
$( "#autocomplete" ).on( "filterablebeforefilter", function ( e, data ) {
var $ul = $( this ),
$input = $( data.input ),
value = $input.val(),
html = "";
$ul.html( "" );
if ( value && value.length > 2 ) {
$ul.html( "<li><div class='ui-loader'><span class='ui-icon ui-icon-loading'></span></div></li>" );
$ul.listview( "refresh" );
$.ajax({
url: "http://gd.geobytes.com/AutoCompleteCity",
dataType: "jsonp",
crossDomain: true,
data: {
q: $input.val()
}
})
.then( function ( response ) {
$.each( response, function ( i, val ) {
html += "<li>" + val + "</li>";
});
$ul.html( html );
$ul.listview( "refresh" );
$ul.trigger( "updatelayout");
});
}
});
});
Is it possible getting data from the DB via ajax using the above code.
Answering ANY of the above questions would be greatly appreciated.
Best regards,
Art