Hi,
I'm building a (small) bibliography into a a website I am working on. Effectively I want the bibliography to run through one file, bibliography.php. Currently I have the bibliography set up as a cloneable template with each page denoting an entry in the bibliography. Here is a simplified version of the code I am using to output the listings in the bibliography and each individual item.
This all works as expected but I am having a bit of difficulty trying to figure out how to display the search results instead of the page listings. I have looked around for a way to detect if the page is pulling search results and display the results instead of the listings content but I can't seem to figure it out. Any help would be fantastic, cheers!
I'm building a (small) bibliography into a a website I am working on. Effectively I want the bibliography to run through one file, bibliography.php. Currently I have the bibliography set up as a cloneable template with each page denoting an entry in the bibliography. Here is a simplified version of the code I am using to output the listings in the bibliography and each individual item.
- Code: Select all
<cms:if k_is_page>
<!-- output single entry in bibliography -->
<h1><cms:show k_page_title /></h1>
<p><!-- other information from given entry --></p>
<cms:else />
<cms:pages masterpage='bibliography.php' limit='10' paginate='1'>
<h2><cms:show k_page_title /></h2>
<p><!-- other information from given entry --></p>
<hr />
</cms:pages>
</cms:if>
<cms:search_form />
<div class="search-results">
<h2>Showing Results for: [Keyword]</h2>
<cms:search masterpage='bibliography.php' limit='10'>
<h3><cms:show k_page_title /></h3>
<p><!-- other information from given entry --></p>
<hr />
<cms:no_results>
<h3>No pages found for <cms:show k_search_query /></h3>
</cms:no_results>
</cms:search>
</div>
This all works as expected but I am having a bit of difficulty trying to figure out how to display the search results instead of the page listings. I have looked around for a way to detect if the page is pulling search results and display the results instead of the listings content but I can't seem to figure it out. Any help would be fantastic, cheers!