Views rows style模板重写代码

重写rows style模板,可以控制整个VIEWS的输出布局,就像VIEWS是个选择器,布局任你编排

以下是代码例子。

复制代码 代码如下:


<?php
$nid = $row->nid;
$country = db_result(db_query('SELECT name FROM {term_data} term_data JOIN {term_node} term_node ON term_node.tid = term_data.tid WHERE term_data.vid = %d AND term_node.nid = %d', 1, $nid));
$investment = db_result(db_query('SELECT name FROM {term_data} term_data JOIN {term_node} term_node ON term_node.tid = term_data.tid WHERE term_data.vid = %d AND term_node.nid = %d', 2, $nid));
?>
<div>
<?php echo $fields['title']->content ?>
<div>
<?php echo $fields['body']->content ?>
</div>
</div>
<div>
<div>
<?php echo $fields['body_1']->content ?>
</div>
<div>
<?php echo instanter_country_code($country) ?> <?php echo $fields['created']->content ?> <?php echo instanter_investment_code($investment) ?>
<?php echo $fields['view_node']->content ?>
</div>
</div>
<div></div>

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/9892977b958b0bff9012c0456c3c5ba4.html