狀況如附件圖檔,我的圖很多,因此有很多頁,不過選頁的部份被我的名字與發表日期檔住了,請教一下這個有辦法修嗎? 附加檔案大小 image.jpg82.79 KB 模組/ModulesImage gallery5.x 發表回應前,請先登入或註冊 Re: Image gallery字跟圖擠在一起 可以把 image gallery 分離出來,放在 theme 中,檔案為 image_gallery.tpl.php , 再配合 CSS 調整。附一個例子給你參考,相關的變數要看你自己的需求調整。 EX: image_gallery.tpl.php <?php global $image_images_per_page; drupal_set_html_head(theme('stylesheet_import', base_path() . drupal_get_path('module', 'image_gallery') .'/image_gallery.css')); $size = _image_get_dimensions('thumbnail'); $width = $size['width']; $height = $size['height']; $height_table = $size['height'] + 20; $content = ''; if (count($galleries)) { $content.= ''; foreach ($galleries as $gallery) { $content .= ' '; if ($gallery->count) $content.= l(image_display($gallery->latest, 'thumbnail'), 'image/tid/'.$gallery->tid, array(), NULL, NULL, FALSE, TRUE); $content.= "".l($gallery->name, 'image/tid/'.$gallery->tid) . "\n"; $content.= ' '. $gallery->description ." \n"; $content.= '' . format_plural($gallery->count, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "\n"; if ($gallery->latest->changed) { $content.= ''. t('Last updated: %date', array('%date' => format_date($gallery->latest->changed))) . "\n"; } $content.= " \n"; } $content.= "\n"; } if (count($images)) { $height += 60; $width2 = $width += 25; $content.= ''; foreach ($images as $image) { $content .= ' sticky) { $content .= ' class="sticky"'; } $content .= ' style="height : '.$height .'px; width : '.$width2.'px; background-image: none; padding-left:0px;"'; $content .= ">\n"; $content .= l(image_display($image, 'thumbnail'), 'node/'.$image->nid, array(), NULL, NULL, FALSE, TRUE); $content .= ''.l($image->title, 'node/'.$image->nid).""; if (theme_get_setting('toggle_node_info_' . $image->type)) { $content .= ''. t('Posted by: %name', array('%name' => theme('username', $image))) . " \n"; if ($image->created > 0) { $content .= ''.format_date($image->created)." \n"; } } $content .= " \n"; } $content.= " \n"; $content.= "\n"; } If (count($images) + count($galleries) == 0) { $content.= '' . format_plural(0, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "\n"; } if ($pager = theme('pager', NULL, variable_get('image_images_per_page', 6), 0)) { $content.= $pager; } print $content; ?> 發表回應前,請先登入或註冊 Re: Image gallery字跟圖擠在一起 hi,根據您的回應我找到這兩篇文章http://drupal.org/node/41257http://drupal.org/node/97700 後來我發現我只需要把張貼者的資訊拿掉就行了 ^^ 發表回應前,請先登入或註冊 Re: Image gallery字跟圖擠在一起 我通常都很偷懶,把那個圖片區塊的高度用CSS去指定,把它加高/寫死XD 發表回應前,請先登入或註冊
Re: Image gallery字跟圖擠在一起 可以把 image gallery 分離出來,放在 theme 中,檔案為 image_gallery.tpl.php , 再配合 CSS 調整。附一個例子給你參考,相關的變數要看你自己的需求調整。 EX: image_gallery.tpl.php <?php global $image_images_per_page; drupal_set_html_head(theme('stylesheet_import', base_path() . drupal_get_path('module', 'image_gallery') .'/image_gallery.css')); $size = _image_get_dimensions('thumbnail'); $width = $size['width']; $height = $size['height']; $height_table = $size['height'] + 20; $content = ''; if (count($galleries)) { $content.= ''; foreach ($galleries as $gallery) { $content .= ' '; if ($gallery->count) $content.= l(image_display($gallery->latest, 'thumbnail'), 'image/tid/'.$gallery->tid, array(), NULL, NULL, FALSE, TRUE); $content.= "".l($gallery->name, 'image/tid/'.$gallery->tid) . "\n"; $content.= ' '. $gallery->description ." \n"; $content.= '' . format_plural($gallery->count, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "\n"; if ($gallery->latest->changed) { $content.= ''. t('Last updated: %date', array('%date' => format_date($gallery->latest->changed))) . "\n"; } $content.= " \n"; } $content.= "\n"; } if (count($images)) { $height += 60; $width2 = $width += 25; $content.= ''; foreach ($images as $image) { $content .= ' sticky) { $content .= ' class="sticky"'; } $content .= ' style="height : '.$height .'px; width : '.$width2.'px; background-image: none; padding-left:0px;"'; $content .= ">\n"; $content .= l(image_display($image, 'thumbnail'), 'node/'.$image->nid, array(), NULL, NULL, FALSE, TRUE); $content .= ''.l($image->title, 'node/'.$image->nid).""; if (theme_get_setting('toggle_node_info_' . $image->type)) { $content .= ''. t('Posted by: %name', array('%name' => theme('username', $image))) . " \n"; if ($image->created > 0) { $content .= ''.format_date($image->created)." \n"; } } $content .= " \n"; } $content.= " \n"; $content.= "\n"; } If (count($images) + count($galleries) == 0) { $content.= '' . format_plural(0, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "\n"; } if ($pager = theme('pager', NULL, variable_get('image_images_per_page', 6), 0)) { $content.= $pager; } print $content; ?> 發表回應前,請先登入或註冊
Re: Image gallery字跟圖擠在一起 hi,根據您的回應我找到這兩篇文章http://drupal.org/node/41257http://drupal.org/node/97700 後來我發現我只需要把張貼者的資訊拿掉就行了 ^^ 發表回應前,請先登入或註冊
Re: Image gallery字跟圖擠在一起
可以把 image gallery 分離出來,放在 theme 中,檔案為 image_gallery.tpl.php , 再配合 CSS 調整。附一個例子給你參考,相關的變數要看你自己的需求調整。
EX: image_gallery.tpl.php
<?php
global $image_images_per_page;
drupal_set_html_head(theme('stylesheet_import', base_path() . drupal_get_path('module', 'image_gallery') .'/image_gallery.css'));
$size = _image_get_dimensions('thumbnail');
$width = $size['width'];
$height = $size['height'];
$height_table = $size['height'] + 20;
$content = '';
if (count($galleries)) {
$content.= '
';- ';
'. $gallery->description ."
foreach ($galleries as $gallery) {
$content .= '
if ($gallery->count)
$content.= l(image_display($gallery->latest, 'thumbnail'), 'image/tid/'.$gallery->tid, array(), NULL, NULL, FALSE, TRUE);
$content.= "".l($gallery->name, 'image/tid/'.$gallery->tid) . "\n";
$content.= '
\n";
$content.= '' . format_plural($gallery->count, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "\n";
if ($gallery->latest->changed) {
$content.= ''. t('Last updated: %date', array('%date' => format_date($gallery->latest->changed))) . "\n";
}
$content.= "
\n";
}
$content.= "
\n";
}
if (count($images)) {
$height += 60;
$width2 = $width += 25;
$content.= '
';- sticky) {
'. t('Posted by: %name', array('%name' => theme('username', $image))) . "
'.format_date($image->created)."
-
foreach ($images as $image) {
$content .= '
$content .= ' class="sticky"';
}
$content .= ' style="height : '.$height .'px; width : '.$width2.'px; background-image: none; padding-left:0px;"';
$content .= ">\n";
$content .= l(image_display($image, 'thumbnail'), 'node/'.$image->nid, array(), NULL, NULL, FALSE, TRUE);
$content .= ''.l($image->title, 'node/'.$image->nid)."";
if (theme_get_setting('toggle_node_info_' . $image->type)) {
$content .= '
\n";
if ($image->created > 0) {
$content .= '
\n";
}
}
$content .= "
\n";
}
$content.= "
\n";
$content.= "
\n";
}
If (count($images) + count($galleries) == 0) {
$content.= '' . format_plural(0, 'There is 1 image in this gallery', 'There are %count images in this gallery') . "\n";
}
if ($pager = theme('pager', NULL, variable_get('image_images_per_page', 6), 0)) {
$content.= $pager;
}
print $content;
?>
Re: Image gallery字跟圖擠在一起
hi,根據您的回應我找到這兩篇文章
http://drupal.org/node/41257
http://drupal.org/node/97700
後來我發現我只需要把張貼者的資訊拿掉就行了 ^^
Re: Image gallery字跟圖擠在一起
我通常都很偷懶,把那個圖片區塊的高度用CSS去指定,把它加高/寫死XD