Hi Folks,
this is not really a feature request, but a proposal of what I'm currently trying to implement. I want to port my band's website to drupal and I want to be able to add a description to the image like in:
http://www.tam-lin.info/musiker.html (all German, but you'll get the idea)
This is done by placing the image and its description inside a div which has the style assigned to the image, like:
<div class="img-right">
<img src="/images/me.jpg" height="319" width="319" alt="My Pic" title="My Pic" />
<p>That's me<br />more descriptive text</p>
</div>
which can now be styled any way you like. Note that the image itself isn't styled.
To achieve this I would like to add another option (desc=0|1) to image_filter.
I'd change the db query to:
-$result = db_query(db_rewrite_sql("SELECT n.nid, n.title, f.filename, f.filepath FROM {files} f, {node} n ...
+$result = db_query(db_rewrite_sql("SELECT n.nid, n.title, n.body, f.filename, f.filepath FROM {files} f, {node} n ...
If desc=1, the body from the image node will be placed in the <p> like in the example above. If desc=0 or not defined, the
will not be created.
desc=1
<div class="img-right">
<img src="/images/me.jpg" height="319" width="319" alt="My Pic" title="My Pic" />
<p>That's me<br />more descriptive text</p>
</div>
desc=0|undefined
<div class="img-right">
<img src="/images/me.jpg" height="319" width="319" alt="My Pic" title="My Pic" />
</div>
What do you think about this?
I'd also suggest to always create the title="" as well, because Firefox doesn't display a hint text when title is not set, whereas IE displays a hint when only the alt="" is set.
Comments
Comment #1
luebbe commentedHi David,
Here's a small patch for image filter, that pulls the description from the image node, creates a paragraph and inserts it into the paragraph, if
desc=1is set. In this case it assignes the image div it creates the class name given in the[image:...]definition. This class has to be defined in the css of course.Comment #2
asb commentedUpdating status and joining the request for image captions/descriptions.
Greetings, -asb
Comment #3
asb commentedThis seems to be a duplicate of #177249: Additional tag for the image description