First of all thanks for a great module.
I am trying to theme the custom_search-result.tpl.php i.e. I have disabled most of the additional info apart from date on the search results page and would simply like to insert 'Posted by' before the date.
I have copied the custom_search-result.tpl.php file to my theme directory and inserted posted into the template file so it now reads:
<dt class="title">some test
<a href="<?php print $url; ?>"><?php print $title; ?></a>
</dt>
<dd>
<?php if ($snippet) : ?>
<p class="search-snippet"><?php print $snippet; ?></p>
<?php endif; ?>
<?php if ($info) : ?>
<p class="search-info">Posted: <?php print $info; ?></p>
<?php endif; ?>
</dd>I have tried refreshing the theme registry by clearing the cache etc and ave even tried moving the custom_search module from sites/all to sites/mydomain for the specific site (multisite install)
Therefore, I would like to ask what if anything I am doing wrong as there does not seem to be any change to the output etc of my site on the search results page. I am assuming but can you confirm that it is possible to use this technique to override the existing custom_search-result.tpl.php file?
Comments
Comment #1
2dareis2do commentedOk,
Turns out the permissions were wrong on the files so they were not being read or executed. Oh yeah and the file I think I needed to override was search-result.tpl.php
Thankyou.
Comment #2
sebumd commentedI'm having this same issue, your fix did not work for me.
Comment #3
T1ckL35 commentedDon't know if it will help here but I started by copying 'custom_search-result.tpl.php' to my theme templates directory (custom theme) and it didnt work.
I heard mention about 'search-result.tpl.php' so renamed my copied 'custom_search-result.tpl.php' to 'search-result.tpl.php', cleared the caches and it worked as expected.
Sooo, it may be worth doing this:
Copy custom_search/theme/custom_search-result.tpl.php to your theme location (e.g, sites/themes//templates/search-result.tpl.php), modify accordingly and then refresh your caches.
Tested on the current stable - custom_search 7.x-1.11
Comment #4
jdanthinne commentedPlease try latest DEV (or use this patch: http://drupalcode.org/project/custom_search.git/patch/e6be0ee) and tell me if it's better.
I've added theme suggestions so you shouldn't need to rename the template file in order to use it.
Comment #5
tomyinhauser commentedI'm using 7.x-1.13 and having the same problem.
Had to rename file from custom_search-results.tpl.php to search-results.tpl.php in my theme.
Comment #6
codecouleurs commentedI'm using 7.x-1.18 and having the same problem.
Had to rename file from custom_search-results.tpl.php to search-results.tpl.php in my theme.
Comment #7
loon commented