Drupal: зависимость блока от свойств нода
У меня не получается передать в блок какие либо переменные нода.
Код:
<h2 style="clear: both;">Последние новости</h2>
<table width="100%" cellpadding="10" border="0">
<tbody>
<tr>
<?php
$output = NULL;
$sql = "select n.nid, n.title, created from {node} n where type='news' order by created desc limit 3";
$result = db_query(db_rewrite_sql($sql));
if (db_num_rows($result)) {
while ($anode = db_fetch_object($result)) {
$output .= "<td width=\"33%\" valign=\"top\">";
$output .= "<strong>".date("d.m.Y", $anode->created)."</strong><br />";
$output .= l($anode->title, "node/$anode->nid");
$output .= "</td>";
}
}
echo $output;
?>
</tr>
</tbody>
</table>
<table width="100%" cellpadding="10" border="0">
<tbody>
<tr>
<?php
$output = NULL;
$sql = "select n.nid, n.title, created from {node} n where type='news' order by created desc limit 3";
$result = db_query(db_rewrite_sql($sql));
if (db_num_rows($result)) {
while ($anode = db_fetch_object($result)) {
$output .= "<td width=\"33%\" valign=\"top\">";
$output .= "<strong>".date("d.m.Y", $anode->created)."</strong><br />";
$output .= l($anode->title, "node/$anode->nid");
$output .= "</td>";
}
}
echo $output;
?>
</tr>
</tbody>
</table>
Как решить?