This a my use case of Drupal:
I want to write a post in my blog with an image
So:
I write a post with the tinymce WYSIWYG editor
I use image_assist to upload an image, I put an image title and description, then I select the uploaded image and I got in the post the thumbnail that links to the image node.
This is very easy to do, but I'd like to show in the post the metadata I wrote for the image in the thumbnail, something similar to what a newspaper does(http://news.bbc.co.uk/2/hi/europe/5193116.stm) and I don't what to rewrite the description on the Image again.
What do you think is the best way to do it?
- a filter?
like [image:234] and then I replace this tag in the post with the correct template(*)
- a filter with regexp on a pseudo-html image tag?
that replace <a href="234_big.jpg"><img id="special" src="234.jpg" /></a>
with my template(*)
This filter would leave intact the logic even if you migrate to other CMSes that doesn't support this translation but you have to convert image name in id.. or load the title from the EXIF/JPTC info embedded in the image
- any other ideas?
I wouldn't like to broke the compatibility with the wysiwyg editor and I'd like to do this changes on runtime, so I could redit the content in future.
This "HTML extension" tecniques could be also used for the syntax highlight of the code like:
<code lang="ruby">
puts 'ciao'
< /code>
in
<code lang="ruby">
<span style="color:red;"puts</span> <span style="color:green;"'ciao'</span>
< /code>
(*)template
Description taken with a query from image id 234 or JPTC