It's my first time creating a search form on couchcms and I have created it by following the search tutorials and it's partly working
I have two cloned pages called Artist One and Artist Two based on a template file called artist.php.
In the search bar, I type artist one and it shows the results for Artist One and Artist Two, I'm guessing this is because I typed the keyword artist in and it's matching the name in the search results
So then I typed in one in the search bar thinking it would just show the search result for Artist One but it's not showing any results. Have I missed something in the code or need to amend some of the code for it to work correctly?
Below is what I have in my header.php file
Below is what I have in search-results.php page
I have two cloned pages called Artist One and Artist Two based on a template file called artist.php.
In the search bar, I type artist one and it shows the results for Artist One and Artist Two, I'm guessing this is because I typed the keyword artist in and it's matching the name in the search results
So then I typed in one in the search bar thinking it would just show the search result for Artist One but it's not showing any results. Have I missed something in the code or need to amend some of the code for it to work correctly?
Below is what I have in my header.php file
- Code: Select all
<cms:form method="get" action="<cms:link 'search-results.php' />" anchor='0' class="hdSearchForm">
<div class="input-group">
<cms:input type="text" class="form-control" value="" name="s" />
<div class="input-group-append">
<button class="btn btn-secondary" type="submit" name="submit">
<i class="icomoon-search"><span class="sr-only">search</span></i>
</button>
</div>
</cms:form>
Below is what I have in search-results.php page
- Code: Select all
<cms:search masterpage='artist.php, artists.php' >
<cms:if k_paginated_top >
<div>
<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:search>