Justin Cutroni propose a way to track searches that don’t produce any results:
http://www.epikone.com/blog/2009/09/08/tracking-ero-result-searches-in-g...
Justin Cutroni propose a way to track searches that don’t produce any results:
http://www.epikone.com/blog/2009/09/08/tracking-ero-result-searches-in-g...
Comments
Comment #1
hass commentedInteresting... and the most difficult part will be to get out if there are search results or not.
Please provide a patch.
Comment #2
hass commentedThis is very specific to themes... not sure how to solve. Aside you can implement it with custom javascript before and after snippets... it would only looks not very nice :-(. At least "sn" and the regex need to be changed for Drupal... 'content' ID may be unavailable in a theme and 'Your search yielded no results' may be translated and a bit more issues...
Snippet (Before):
Snippet (After):
Comment #3
Anonymous (not verified) commentedI see, there's not a easy way on drupal :(
Thanks for the code
Comment #4
hass commentedAs said - this *hardly* depends on theme HTML code. I have no idea how to implement this in a generic way if core does not provide us the number of found results in a hook or via a function calll :-(. If someone is able to come up with a way I would be happy to implement this.
Comment #5
hass commentedLet's investigate if there is a way in D7...
Comment #6
hass commentedFound something, but need to dig deaper... And do some testing
http://api.drupal.org/api/drupal/modules--search--search-results.tpl.php... with
Your search yielded no results.http://api.drupal.org/api/drupal/modules--search--search.pages.inc/funct...
Comment #7
hass commentedImplemented search result counter in piwik successfully. Can be ported, but I would also be interested to always get the results and not only if there is no result.
Comment #8
hass commentedCommitted to D6 and D7