Currently node teasers are using the search results template (contentdm_search_results_list_item) - it's more flexible if teasers have their own template – this patch implements that.

Since there's a lot of code in the preprocess function that search results and teasers both need, I renamed that preprocess function to be generic (template_preprocess_contentdm_item), and now call it from template_preprocess_contentdm_search_results_list_item and template_preprocess_contentdm_node_teaser - leaves the door open for separate customizations later while sharing the base.

CommentFileSizeAuthor
contentdm_teaser.patch3.99 KBlaken

Comments

markj’s picture

Andy, sorry for the delay, I had to spend some time testing this patch. I'll apply it and push it up to -dev but I have a couple of questions/comments.

1) Do you mind if I name the new function template_preprocess_contentdm_summary_item() since I have used the pattern '_contentdm_item()' elsewhere for the full, node-level instantiation of a contentdm_wrapper node? 'Summary' is a bit non-Drupal but it is a superset of both the teaser and the search result item.

2) I've tested overriding both the teasers and search result items by adding my own preprocess functions in template.php. So, local implementors can override both independently, thanks to your patch.

3) I asume that this patch means we can remove the OG code at the end of template_preprocess_contentdm_summary_item() -- is that correct? If so, I'll remove it and commit this change to -dev.

4) As a corollary of #3, you will need to write a preprocess override function in your contentdm_og module to add the 'addons' variable, correct?

This is a great improvement to the contentdm.module, thanks very much for thinking of it.

markj’s picture

Status: Active » Closed (fixed)