Instead of showing the last modified date, I need to display the publish date of nodes in the search results.
This article shows how to solve this in D5, but it seems that theme_search_item() isn't availiable anymore in D6.

Any ideas how to get this working?

Comments

BarisW’s picture

Anyone?

jhodgdon’s picture

Status: Active » Fixed
BarisW’s picture

Status: Fixed » Active

No you cannot. $info_split only contains the last modified date, not the created date.

jhodgdon’s picture

Version: 6.13 » 8.x-dev
Category: support » feature

Ah, you are correct. In that case, it's a feature request. Drupal 6/7 are not taking feature requests at this time (only bug fixes), so I'll add it to the list for Drupal 8.

jhodgdon’s picture

One other note. You could do this with a very small module, using hook_search_result() to add the information to the search result, and then in your theme, process it correctly in the preprocess_search_result function.

glowrocks’s picture

Based on the great work done by Aaron at the Roving Coder, I've put together a solution for this that involves using the $result variable in the search-result.tpl.php file (which along with search-results.tpl.php has been copied to your theme directory).

http://www.allthepages.org/d6/archives/2010/07/drupal-display-creation-d...

jhodgdon’s picture

Category: feature » support
Status: Active » Fixed

In drupal 7/8 we have
hook_node_search_result()
https://api.drupal.org/api/drupal/core!modules!node!node.api.php/functio...
which allows a module to add information to be displayed in a search result, and we have search-result.tpl.php or search-result.html.twig, which your theme can override (or the preprocess function) to make that information displayed the way you want it. So this essentially exists, and does not need to be added to core.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.