, "", node -blog.tpl.php , . $teaser TRUE node -blog.tpl.php, Drupal , $page TRUE, node ( FALSE, node ). node -blog.tpl.php, , , HTML, . node -blog.tpl.php :
if($teaser){
//return teaser html
}
else{
//return full node HTML
}
, , - node -blog.tpl.php, . . Drupal , Wordpress.
, /blogs/eric, Views. "" , , "".
HTML node , node -blog.tpl.php, :
<?php if ($page): ?>
My arbitrary HTML here which will not show up in teasers and only at the top of full blog pages
<?php endif; ?>
<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">
<div class="item">
<ul>
<?php print $picture ?>
<?php if ($page == 0): ?>
<?php endif; ?>
<div class="content clear-block">
<li class="title"><h4><?php print $title ?></h4></li>
<li class="photo"><a href="#"><img src="/<?php print $node->field_blog_image[0]['filepath']; ?>" /></a></li>
<li class="desc"><?php print $node->content['body']['#value']; ?></li>
<li class="link">
<?php if ($teaser): ?>
<a href="<?php print $node_url ?>" class="block-link">Read more</a> | <a href="<?php print $node_url ?>" class="block-link">Audio/Video</a> |
<?php endif; ?>
<?php print $submitted; ?>
</li>
<div class="clear"></div>
</div>
<div class="clear-block">
<div class="meta">
<?php if ($taxonomy): ?>
<div class="terms"><?php print $terms ?></div>
<?php endif;?>
</div>
</div>
</ul>
</div>
</div>
, , Blog
HTML , -blog.tpl.php