How to make custom Titles, Summaries, and Descriptions for each separate image (for HTML tags)

capt_kirk

Joined: 2006-01-24
Posts: 492
Posted: Tue, 2007-11-13 14:58

In G2Image 3.0.x, you cannot create custom title= attributes for each image when inserting a HTML tag. You get the item summary that is in Gallery2 and it cannot be edited. (The title= attribute is used for the "mouseover" text that appears when you hover the mouse over the image.)

I'll add this fix to version 3.1, but in the meantime, you can modify the item summary in the "Thumbnails with info" view in G2Image by making the following changes to g2image.php:

1) Around line 817 in g2image.php, change the lines that read

$html .= '        ' . T_('Title:') . ' ' . htmlspecialchars($item_info['title']) . '<br />' . "\n"
. '        ' . T_('Summary:') . ' ' . htmlspecialchars($item_info['summary']) . '<br />' . "\n"
. '        ' . T_('Description:') . ' ' . htmlspecialchars($item_info['description']) . '<br />' . "\n";

to read

$html .= '        ' . T_('Title: (used for alt in HTML)') . ' <input type="text" name="item_title" size="60" maxlength="200" value="' . htmlspecialchars($item_info['title']) . '" /><br />' . "\n"
. '        ' . T_('Summary: (used for title in HTML)') . ' <input type="text" name="item_summary" size="60" maxlength="200" value="' . htmlspecialchars($item_info['summary']) . '" /><br />' . "\n"
. '        ' . T_('Description: (used for caption in Lightbox)') . '<input type="text" name="item_description" size="60" maxlength="200" value="' . htmlspecialchars($item_info['description']) . '" /><br />' . "\n";

2) Around line 836, delete the lines that read

. '    <input type="hidden" name="item_title" value="' . $item_info['title'] . '" />' . "\n"
. '    <input type="hidden" name="item_summary" value="' . $item_info['summary'] . '" />' . "\n"
. '    <input type="hidden" name="item_description" value="' . $item_info['description'] . '" />' . "\n"

This will create editable fields that are pre-populated with the information from Gallery2. You can view and change them by clicking on "Thumbnails with info" in the Display Options box.

Kirk
____________________________________
G2Image Documentation, G2Image Demo Page, My Family Website