Modifying Drupal core (search module, image module) I have a couple of modifications I did to the Drupal core:


search module: I added a class to the &lt;ul&gt; that contains the "no-results" text.
image module: I changed the 'title' attribute to have a #maxlength of 500 for a specific content type, so that only nodes of that type can have a longer 'title'


The question is: how would I do that without modifying the Drupal core? Is there a way of overriding those default outputs in a custom module? I'm looking for a way of doing that without touching the core, or to confirm that a modification in the core was the only feasible way.
I'm not sure how the second one is Image module-specific, but you would override that maxlength like so:

function hook_form_[content-type]_node_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    $form['title']['#maxlength'] = 500;
}


... where 'hook' is replaced with the name of your custom module, and [content-type] is the machine name of your content type.

The API function is hook_form_FORM_ID_alter()

For the search form theming, you probably want something like template_preprocess_search_results() in your template.php of your custom theme, and/or adding a custom search result template to the theme's templates folder.

Oh, and in case it needs saying again,

DON'T HACK CORE