Настройка галереи

Главные вкладки

Аватар пользователя fl00r fl00r 19 августа 2006 в 22:12

Как можно ручками переделать стандартную галерею?
Из цсс ничего не настраивается. Может как-то функции переопределить можно? Никто не знает?

Комментарии

Аватар пользователя Natalie Natalie 20 августа 2006 в 2:39

Стандартная галерея - это что? Image +image gallery?
---
---
All content management systems suck, Drupal just happens to suck less. -- Boris Mann at DrupalCON Amsterdam, August 2005.

Аватар пользователя B.X B.X 21 августа 2006 в 4:04

там в некоторых местах придётся в модуль лезть... во многих тегах нет ни идентификаторов, ни классов (безобразие, конечно)... хотя, и во многих стандартных модулях это присутствует, я сам исправлял в user и node и отправил на drupal.org (обещали включить в cvs)...

Аватар пользователя fl00r fl00r 21 августа 2006 в 13:03

И все же, какая функция ответственна за отображение галереи? Она работает на div'ах (очень криво), я бы хотел переделать все в таблицу... где искать?

Аватар пользователя Natalie Natalie 21 августа 2006 в 16:53

ищите в модуле галереи функции theme_что-нибудь
---
---
All content management systems suck, Drupal just happens to suck less. -- Boris Mann at DrupalCON Amsterdam, August 2005.

Аватар пользователя fl00r fl00r 21 августа 2006 в 17:31

ok, thx.
/modules/image/contrib/image_gallery

[.........

function theme_image_gallery($galleries, $images) {
drupal_set_html_head(theme('stylesheet_import', base_path() . drupal_get_path('module', 'image_gallery') .'/image_gallery.css'));

// We'll add height to keep thumbnails lined up.
$size = _image_get_dimensions('thumbnail');
$width = $size['width'];
$height = $size['height'];

$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.= '

    '. check_markup($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 += 75;
$content.= '

    ';
    foreach ($images as $image) {
    $content .= '
  • sticky) {
    $content .= ' class="sticky"';
    }
    $content .= ' style="height : '.$height .'px; width : '.$width.'px;"';
    $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";
}

if ($pager = theme('pager', NULL, variable_get('image_images_per_page', 6), 0)) {
$content.= $pager;
}

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";
}

return $content;
}

.......]

Аватар пользователя Natalie Natalie 21 августа 2006 в 18:34

Угу, теперь с этим надо разбираться.
---
---
All content management systems suck, Drupal just happens to suck less. -- Boris Mann at DrupalCON Amsterdam, August 2005.