I want to print custom text if there is no result on search.
I'm using custom search-result.tpl.php
and search-results.tpl.php
.
My search-results.tpl.php is that:
<?php if ($search_results): ?>
<h2><?php print t($search_totals);?></h2>
<div class="view-content">
<table class="views-table cols-4 search-results <?php print $module; ?>-results table table-striped">
.../* my results style here */
<tbody>
<?php print $search_results; ?>
</tbody>
</table>
</div>
<?php print $pager; ?>
<?php else : ?>
<h2><?php print t('Your search yielded no results');?></h2>
<?php print search_help('search#noresults', drupal_help_arg()); ?>
<?php endif; ?>
It works correctly if there are search results but if there is no result it doesn't print anything although there is the <?php else : ?>
part.
How can I print custom text if there is no result?