服务器之家:专注于服务器技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|Java教程|ASP教程|编程技术|正则表达式|C/C++|IOS|C#|Swift|Android|VB|R语言|JavaScript|易语言|vb.net|

服务器之家 - 编程语言 - PHP教程 - Views rows style模板重写代码

Views rows style模板重写代码

2019-11-25 13:50PHP教程网 PHP教程

重写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 class="article-l"> 
<?php echo $fields['title']->content ?> 
<div class="left-content"> 
<?php echo $fields['body']->content ?> 
</div> 
</div> 
<div class="article-r"> 
<div class="right-content"> 
<?php echo $fields['body_1']->content ?> 
</div> 
<div class="article-link"> 
<?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 class="clear-both"></div> 

延伸 · 阅读

精彩推荐