Latest Journal Entry
Whilst redesigning the site i came across what seem to be a common problem with the textpattern CMS The blank page returned by a search with no results. So i tried to find a fix.
With a little bit of searching around, and a quick trip to the amazing textbook website i quickly found a plug-in which claimed to fix my little blank page problem.
The plug-ins name is rss_if_search_results and is another one of the great wilshireone.com plugins.
At first, this plug in seemed perfect for what i needed, It promised to alow me to display a useful message when no search results were returned, however, for some reason i was unable to get this to work.
After a little more experimenting i found the chh_if_data plug in and this post describing its use. The implementation of this plug in was not quite as obvious as the other plug in, so i feel the need to share the code ( love )
After installing the plug-in, go to you default page, and place the following code into the place you wish the search results or message to be displayed.
<txp:if_search> <txp:chh_if_data> <p>Here’s an article list containing your search inquiry</p> <txp:article /> <txp:else /> <p>No articles found</p> </txp:chh_if_data> </txp:if_search>
A nice touch when using the above form with the message displayed when results are found would be to edit the form named search_results to:
<p><txp:search_result_title ></p>
With this method in place, the blank screen when there is no search results is resolved.
Commenting is closed for this article.
Flickr Photos
Latest Content
After 14 months with the Unibody MacBook i review how i have found the machine in use on a daily basis.
More ::
This post is the first in a series which are being spawned by a little project called project52! Project52 is a website which was dreamed up by anton to get more people writing!