www.tvdrupal.com | Drupal中文视频教程 文档源码
首页通过views_get_view 得到多个列表。 主要是三个文件: page--front.tpl.php 通过下面代码来调用: -------------------------------- display/indexlist.tpl.php field_image['und'][0]['uri'])){ $image_uri = $term->field_image['und'][0]['uri']; $cateimg = file_create_url($image_uri); } else $cateimg = $base_path.'/sites/default/files/grid.jpg'; ?>
更多
name;?>
field_image['und'][0]['uri'])){ $image_uri = $term->field_image['und'][0]['uri']; $cateimg = file_create_url($image_uri); } else $cateimg = $base_path.'/sites/default/files/grid.jpg'; ?>
更多
name;?>
--------------------------- display/indexlist_ul.tpl.php
更多
name;?>
set_display('block_indexlist'); $view->set_arguments(array($taxoid)); //如果是views_get_view,则这里的参数是一个数组。 // change the amount of items to show $view->set_items_per_page(8); $view->pre_execute(); $view->execute(); print $view->render(); //return $view->result; //pre($view->result); if(sizeof($view->result)>0){ foreach($view->result as $id=>$v){ $nodeindex = node_load($v->nid); $url = url('node/' . $v->nid); if(isset($nodeindex->field_image['und'][0]['uri'])){ $style = 'thumbnail'; $imgv = image_style_url($style, $nodeindex->field_image['und'][0]['uri']); } else { $imgv = $base_path.'/sites/default/files/grid.jpg'; } if($id==0){ $img='
';} else {$img='';} ?>
node_created);?>
node_title;?>
no result..';} ?>
power by
tvdrupal.com
欢迎加入drupal主题会员