For me, concenated images to the teaser and the body is very limiting.

I want the image to appear somewhere else, wrapped in some more advanced HTML. image.module as it is now, does not allow this, because it has the concenation hardcoded.

This patch introduces two thelme functions theme_image_teaser and theme_image_body.

CommentFileSizeAuthor
#5 image_theme_0.diff1.62 KBBèr Kessels
image_theme.diff991 bytesBèr Kessels

Comments

ezheidtmann’s picture

+1. Sounds like a good idea to me, and the code looks sane.

basicmagic.net’s picture

hi ber-
what does this do exactly...?
how would you use it...
any more info on this would be greatly appreciated...

ezheidtmann’s picture

These are theme functions you can override in your theme. See the docs: http://drupal.org/node/11774

Robrecht Jacques’s picture

+1 on the idea.

I'm wondering though if this patch will work. What is $request set to in

function theme_image_body($node) {
 return image_display($node, $request) . $node->body;
}

? Obviously not to $request = ($_GET['size']) ? $_GET['size'] : 'preview'; as it was before.

Maybe the theming functions need to be:

function theme_image_body($node, $size = 'preview');
function theme_image_teaser($node, $size = 'thumbnail');

The last one just out of consistency.

Bèr Kessels’s picture

StatusFileSize
new1.62 KB

oops; the preview was wrong. My theme did not mind, so I never saw this bug. this patch fixes that.

Bèr Kessels’s picture

Still applies. Please review! please?

Robrecht Jacques’s picture

Status: Needs review » Reviewed & tested by the community

Tested this patch (of comment #5): applies, works as described, coding style ok.
These theming functions won't hurt anyone.
I propose to commit it to CVS and 4-6.

Bèr Kessels’s picture

bump. walkah, what is holding this patch? If you have no time, I can commit it too, after you say so.

zach harkey’s picture

+1 I don't know how people are getting by without this.

Bèr Kessels’s picture

Again: boing

please, give an update on this. Ii is very critical for me to know if this patch may make it in or not!! I am willing to commit it myself, but I need feedback! walkah? robrecht? anyone, should I commit it?

Robrecht Jacques’s picture

This is ready to be committed. Except for:

-    $result = pager_query(db_rewrite_sql("SELECT n.nid FROM {term_node} t INNER JOIN {node} n ON t.nid=n.nid WHERE n.status=1 AND n.type='image' AND t.tid=%d ORDER BY n.sticky DESC, n.created DESC"), 6, 0, NULL, $tid);
+    $result = pager_query(db_rewrite_sql("SELECT n.nid FROM {term_node} t INNER JOIN {node} n ON t.nid=n.nid WHERE n.status=1 AND n.type='image' AND t.tid=%d ORDER BY n.sticky DESC, n.created DESC"), variable_get('image_images_per_page', 6), 0, NULL, $tid);

That hunk will fail.

BTW: in my "sandbox-image" I've added this too, because I think it is very usefull and probably needed.

Bèr Kessels’s picture

Yup.

My misake. I have anew patch that removed that line. I will commit later. this weekend or Monday.

Bèr Kessels’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)