to make nice themed imags, I need more information.

For example http://drupal.org/node/21811 to make images square perfoms horribly bad, because on theme level I have no access to the $bnode object.

This patch intyroduces a simple theme function where we can do really really nifty stuff. Square images, shaded borders, CSSed overlays etcetc.

PLease comment and/or apply.

CommentFileSizeAuthor
theme_inline_image.patch980 bytesBèr Kessels

Comments

Bèr Kessels’s picture

bump

Tobias Maier’s picture

maybe I work not enough with drupal to see how to use this in a good way

do you have a good example how to use this new function?

I would like it if the description which is possible now (by upload.module)
would be put into the alt-attribute by default, is this possible with this patch?

Bèr Kessels’s picture

Two things I need this patch for are to:
* make thumbnails square with CSs
* Add shadowed borders to the thumbnails

Some more things one can do after this patch is:
* Use any data from the node as alt
* Add CSS watermarks
* Add data about the node to the image, like the title, the comments, the teaser etc. One can indeed do this in the alt tag, but also in any other place.

And no, unfortunately this is not really possible on the level of theme_node, for the images are rendered outside of the node context too. for example in a block.

Bèr Kessels’s picture

One more reason why this is bqdly needed.

Currently we pass along the full url to theme_image. I for example, want to do getsize in the theme function, which needs ugly grepping of $base_url, With this patch I have all the data I need for such more advanced theme issues.

Can a maintainer please tell me at least if they want this feature in image module?

Bèr Kessels’s picture

what more must I do to get this in focus of the mainainers?

walkah’s picture

sorry ber - took a little time off for the US holiday last week...

where / how are you using theme_image_inline from?? (and why does this need to be in image.module)?

Bèr Kessels’s picture

image module curerntly uses the sidewide theme_image function.

Which means that If i want to style my image.module inline image strings different, I need o do so for any image.

For example: look at the XML icons on http://www.webschuur.com/blog/drupal_blog, it is "square" too, because I want y other images to be square :)

Another example is the abovementioned one, where I want simply more information, I therefore want to have access to the $node object in the theme function. It is near to impossible (only possible with database queries against the files DB) to get that information when the theme function is building the "img string"

and as you can see, the new theme_inline_image is not much moer than an image module specific wrapper around the global theme_image. So, by default, nothing much happens. Just in case one needs advancs img strings, this function will allow that.

patchak’s picture

Hi,

Is this patch only to use with inline images or I can use it to make square thumbnails in my image gallery?

Thank you

drewish’s picture

i think it's a good idea to add the theme function but i really don't like the name.

Hetta’s picture

Version: 6.x-1.x-dev » 4.7.x-1.x-dev
Status: Needs review » Fixed

From 2005 - possibly a 4.7 problem? Please reopen if it's still a problem.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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