Displaying captions in a gallery?
HansBKK - October 20, 2008 - 16:36
| Project: | MAQUM |
| Version: | 5.x-1.0 |
| Component: | Documentation |
| Category: | task |
| Priority: | normal |
| Assigned: | Brian@brianpuccio.net |
| Status: | needs review |
Jump to:
Description
Excellent idea, haven't tried it out yet, at the moment checking out different ways of doing Galleries before I decide whether to use Image module nodes or Imagefield CCK (or in the case of Brilliant Gallery neither is needed)
So far I've only seen that Acidfree and the module that ships with Image create galleries from Image nodes - any others recommended?
If I go with Image nodes, I'll definitely be putting this module into the workflow!
If I have data already in my images' IPTC caption fields and/or EXIF description fields, how can I get galleries that then display the caption properly but not all the other data?
I suppose I could do it myself in Views, any suggestions along those lines?

#1
Since right now (first release, D5 branch) MAQUM just creates taxonomy for everything, here's what my
node-image.tpl.phplooks like:<h1><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h1>
<?php print $content ?>
<div class="meta"><p>
<?php if ($submitted): ?>
Date: <?php print format_date($node->created, $type = 'large'); ?><br />
<?php endif; ?>
<?php if ($terms): ?>
Keywords: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 9, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
Shutter Speed: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 23, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
Aperture: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 13, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
Focal Length: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 16, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
ISO: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 22, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
Exposure Program: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 14, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
White Balance: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 17, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
Metering Mode: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 24, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
Flash: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 15, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
Make: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 12, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
Model: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 11, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
Location: <?php
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 19, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
print ", ";
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 21, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
print ", ";
$termcounter = 0;
foreach ((array)taxonomy_node_get_terms_by_vocabulary($nid, 20, $key = 'tid') as $term) {
if ( $termcounter > 0 ) {
print ", ";
}
$link = l(t($term->name), "taxonomy/term/$term->tid", array("title" => t($term->description)));
print $link;
$termcounter++;
}
?><br />
<?php endif;?>
<?php if ($links): ?>
Links: <?php print $links; ?><br />
<?php endif; ?>
</p></div>
(In part, anyhow)
Let me know if you need more help.
#2
Wow.
Thanks, I guess, I'll go through this and figure it out.
But it could also be done in Views couldn't it?
#3
This just themes the image nodes. See Theming nodes by content type in the handbook for more information about theming nodes and specific content types (in this case, images). Also check out the Contemplate module (even though MAQUM doesn't take advantage of CCK fields) for a more interactive and visual, less programmy way to theme your nodes.
I'll be glad to help with any issues you have. :)
#4
Now I am confused - I had thought your module created standard Image type nodes, and assumed worked by adding CCK fields to those. Please clarify, specifically what happens to my content if say ten years down the road I can't use your module anymore.
Also, please address the Views integration questions, I'm trying to stick to that rather than the alternatives you pointed out.
Thanks. . .
#5
As indicated in the info file:
; $Id$name = MAQUM
description = "Metadata Aware Quick Upload Module: a module which creates image nodes with EXIF and IPTC metadata."
dependencies = taxonomy image
package = Image
The only thing that it depends on is image and taxonomy, it has nothing to do with CCK. The reason it depends on taxonomy is because it create vocabularies for certain metadata fields embedded in the image. Again, nothing to do with CCK. There is no mention of CCK at all on the current project information page. It currently says:
Feel free to remove MAQUM at any time, all MAQUM does is create an image node. Your content will not change in the least. Your real question is what happens to your content ten years down the road and you can't use image module any more. For the answer to that question, I'll refer you to the image module for that question since I am not the image module maintainer. I would like to point out that Drupal, image module and MAQUM are all open source, so in terms of "can I use this in x years" the answer should be obvious.
As for your concerns about displaying the content, sorry, this isn't really a MAQUM question. You're trying to adjust how your image nodes appear in a gallery. Last I checked, that was a theming question as it pertains to image nodes. That being said, I did show you how to theme nodes, gave you a link to the relevent handbook pages and at this point, this is all I have time to do. If you insist on figuring out a views way, you're more than welcome to, but I cannot and will not help past this point.
Please understand again what MAQUM does -- create image nodes. Anything outside of the creation of the content is well outside the scope of this module. If you want your image nodes to look different, whether it be a gallery, a block or the node itself, it really has nothing to do with MAQUM. MAQUM just creates nodes for you with the metadata in the photo so you don't have to do it manually.
#6
Sorry for my confusion, I'm trying to deal with too many different image-handling methods at a time and didn't take the time to re-visit your docs.
Personally I think Image will stick around long term, and if not its installed base will ensure a well-tested migration path. I'm glad to hear that MAQUM generates standard Image nodes and obviously Taxonomy is also an excellent way to store the meta data from a longevity/compatibility point of view.
Completely understand the time issue, you've been very helpful, thanks.
Here's an edit to your opening intro to help clarify things for lazy quick-scanners like me, feel free of course to use or ignore:
MAQUM is short for Metadata Aware Quick Upload Module. MAQUM works with (and relies upon) Drupal's (core) Taxonomy and (contrib) <a href="/project/image">Image</a> modules to help automate the:
<ul><li>uploading of image files</li>
<li>creation of standard Image type nodes</li>
<li>creation of Taxonomy vocabularies to store the EXIF and/or IPTC metadata contained in your image files</li>
<li>tagging of the resulting nodes with those terms</li></ul>
Note that the nodes MAQUM creates are not proprietary in any way, so your data is accessible to all standard and compatible Drupal functions without any further dependence on MAQUM.
Instead of uploading an image directly with the image module. . .
Thanks again for your time Brian!
#7
#8
This is valuable feedback. I'll update the project page tonight to reflect this.
My email is brian@brianpuccio.net, drop me a line next week (after midterms) and I'll help you with your issues with displaying content the way you want if I can.
Thanks!
#9
Thanks Brian, you've given me plenty to chew on for now :)