Hi there! Have searched the forum and documentation to no avail, and have also tried various things that simply do not work (including what I thought was a fairly simple answer on this forum!)
Quick explanation of the site I have - there are lots of template pages, and the cloned pages can be 'tagged' with certain steps in a process. For each of these template pages there can be a cloned page called 'Overview' which provides an overview of all the other pages, and allows users to filter pages by the aforementioned tags by clicking various steps within the overview. This is pertinent because, as one would expect, the overview pages contain a lot of 'keywords' one might search for, but absolutely no relevant information about those keywords.
Whenever I use the search function for any relevant word, multiple Overview pages are in the results because they all contain these keywords. I would really REALLY like to exclude these pages from the search results. Note: for the additional functionality of the website to work, these pages must be page_name 'overview'. This, therefore, is a reliable filter!
My search page currently looks like this:
What I wanted to do was amend the search to exclude page_name 'overview'. So I tried this:
This did not work. So I did more digging, and found that this can be done when using the 'pages' tag. The write-up for the search tag suggests that most of the functionality of the pages tag is also available within the search tag. I also tried
just to test whether I could exclude a given page, but page id 27 still came up in the results. I must therefore assume I am going about this the wrong way.
Help please?
Thank you
Anthony
Quick explanation of the site I have - there are lots of template pages, and the cloned pages can be 'tagged' with certain steps in a process. For each of these template pages there can be a cloned page called 'Overview' which provides an overview of all the other pages, and allows users to filter pages by the aforementioned tags by clicking various steps within the overview. This is pertinent because, as one would expect, the overview pages contain a lot of 'keywords' one might search for, but absolutely no relevant information about those keywords.
Whenever I use the search function for any relevant word, multiple Overview pages are in the results because they all contain these keywords. I would really REALLY like to exclude these pages from the search results. Note: for the additional functionality of the website to work, these pages must be page_name 'overview'. This, therefore, is a reliable filter!
My search page currently looks like this:
- Code: Select all
<div class="col-xl-12 py-sm-2" id="searchpage">
<div class="col-12"><h1> Search results: </h1></div>
<div class="row" id="searchresults">
<cms:search limit='10' >
<cms:if k_paginated_top >
<div class="col-12">
<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>
<div class="col-xl-3 col-lg-4 col-md-6 my-2">
<div class="card shadow searchresult">
<h3 class="card-header"><a href="<cms:show k_page_link />"><cms:show k_search_title /></a></h3>
<div class="card-body">
<p class="card-text"><cms:show k_search_excerpt /></p>
</div>
</div>
</div>
<cms:paginator />
</cms:search>
</div>
</div>
What I wanted to do was amend the search to exclude page_name 'overview'. So I tried this:
- Code: Select all
<cms:search limit='10' page_name='NOT overview' >
This did not work. So I did more digging, and found that this can be done when using the 'pages' tag. The write-up for the search tag suggests that most of the functionality of the pages tag is also available within the search tag. I also tried
- Code: Select all
<cms:search limit='10' id='NOT 27' >
just to test whether I could exclude a given page, but page id 27 still came up in the results. I must therefore assume I am going about this the wrong way.
Help please?
Thank you
Anthony