Drupal 是一套開放源碼的內容管理平台,擁有多種實用的功能,可以用來建置從個人網誌到大型網路社群等各種類型的網站,例如華納唱片、紐約觀察報、Fast Company、Popular Science、SonyBMG、富比士、哈佛大學等網站,或是個人部落格(Tim Berners-Lee)、播客網站(TWIT.tv)、線上社群(SpreadFireFox.com)。
Drupal 是一套開放源碼的內容管理平台,擁有多種實用的功能,可以用來建置從個人網誌到大型網路社群等各種類型的網站,例如華納唱片、紐約觀察報、Fast Company、Popular Science、SonyBMG、富比士、哈佛大學等網站,或是個人部落格(Tim Berners-Lee)、播客網站(TWIT.tv)、線上社群(SpreadFireFox.com)。
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