I need captions

kimblev
kimblev's picture

Joined: 2008-09-09
Posts: 3
Posted: Tue, 2008-09-09 17:15

I am using Drupal 6.2, Gallery2, TinyMCE, g2Image, and the drupal Gallery module. It's all up and running OK (after days of hair pulling) but when I embed a G2 image in a story using TinyMCE/g2Image, I need a caption. The contents of the title field or description field would be fine. In fact, I am sure a small modification of the php is all that is needed for me since the title field already shows up in the image tag. I just need it to also appear outside the image tag. My problem is I can't figure out which file, of the hundreds of files used in this configuration, builds the HTML generated when I embed a G2 image into a node.

 
steinmb01
steinmb01's picture

Joined: 2005-04-07
Posts: 31
Posted: Sun, 2008-09-28 13:37

HI
I'm not sure how to solve this then I have not used g2Image but I good place to start is looking the gallery module dir. All functions starting with "theme_" are you easily able to override in your theme by taking a copy of the functions and pasting them into template.php.

Drupal enable you do do this to prevent users from having make a branch of the module by editing the module code directly. So if you look in gallery_g2image.inc you will find:

<code>
/**
* Theme function : theme_gallery_g2image_textarea_link().
* (for adding an image link underneath textareas)
*/
function theme_gallery_g2image_textarea_link($element, $link) {
$output = '<div class="g2image-button"><a class="g2image-link" id="g2image-link-'. $element['#id']
.'" title="'. t('Click here to add images from Gallery2 albums')
.'" href="#" onclick="g2image_open(\''. $element['#id'] .'\');">';
$output .= t('Add Gallery2 images');
$output .= '</a></div>';

return $output;
}
</code>

Remember that if you want to use this in template.php you have to rename the function from "theme_gallery_g2image_textarea_link" to "your-theme-name_gallery_g2image_textarea_link"

I hope this could point you in the right direction (that is if it is the right direction :) )

--
Steinmb