Есть известный модуль Arcal все ок, но мне необходимо чтобы при выводе списка материалов была еще и картинка из этого материала.
Картинка это CCK поле в ноде field_image.
НАшел в модуле след код
<?php
*/
function theme_arcal_overview($node) {
$output = '';
$output .= '<div class="one_news">';
$output .= '<div class="metadata">';
$output .= '<div class="fright">';
$output .= '<span class="author">'. $node->name .'</span>';
$output .= '</div>';
$output .= '<div class="fleft">';
$output .= format_date($node->created, 'custom', 'Y-m-d') .' | <span class="c'. $node->comment_count .'">'. $node->comment_count .'</span>';
$output .= '</div>';
$output .= '</div>';
$output .= '<div class="clear"></div>';
$output .= '<h2 class="title">'. l($node->title, 'node/'. $node->nid) .'</h2>';
$output .= '<div class="teaser">'. check_markup($node->teaser) .'</div>';
$output .= '<div class="clear"></div>';
$output .= '<div class="readmore">'. l(t('read more'), 'node/'. $node->nid) .'</div>';
$output .= '<div class="clear"></div>';
$output .= '</div>';
return $output;
}
?>
Он как раз и выводит список нод.
пытаюсь добавить след код
<?php
$output .= '<DIV class="image">'. $node->field_image[0]['view'] .'</div>';
?>
И ничего не появляется.
Если вставить, например, в node.tpl.php, echo $node->field_image[0]['view'] то картинка появляется.
Хелп, плиз!
Комментарии
UP! Проблема все актуальна![Sad](https://drupal.ru/sites/all/modules/contrib/smiley/packs/kolobok/sad.gif)
Добавил след. код
<?php
$output .= $field = content_fields('field_image', $node->type);
print content_view_field($field, $node, $teaser = TRUE,$page = FALSE);
?>
Теперь, почемуто, в самом верху сайта выстраиваются в столбик изображения, а в тексте, где по идее они должны быть, пишет Array...
<?php
function theme_arcal_overview($node) {
$field = content_fields('field_image', $node->type);
$img = content_view_field($field, $node, $teaser = TRUE,$page = FALSE);
$output = '';
$output .= '<div class="one_news">';
$output .= '<div class="metadata">';
$output .= '<div class="fright">';
/* $output .= '<span class="author">'. $node->name .'</span>';*/
$output .= '</div>';
$output .= '<div class="fleft">';
$output .= '</div>';
$output .= '</div>';
$output .= '<div class="clear"></div>';
$output .= '<h2 class="title">'. l($node->title, 'node/'. $node->nid) .'</h2>';
$output .= '<div class="img">'. $img .'</div>';
$output .= format_date($node->created, 'custom', 'Y-m-d') .' | <span class="c'. $node->comment_count .'">'. $node->comment_count .'</span>';
$output .= '<div class="teaser">'. check_markup($node->teaser). '</div>';
$output .= '<div class="clear"></div>';
$output .= '<div class="readmore">'. l(t('read more'), 'node/'. $node->nid) .'</div>';
$output .= '<div class="clear"></div>';
$output .= '</div>';
return $output;
}
?>
Работает!