Drupal China
先簡單講一下背景
創建了Staff 的content type, 又創建了一個taxnonmy (staff)有兩個term, Principal, Senior techaer
作用是create 新node (staff content type) 時選擇這個staff 是principal, 或senior teacher
問題是,除了用views 來將所有關於staff taxonomy 的 staff content 列出來 還有沒有其他方法?
因我用的是drupal 6.3, views 就只能用目前views2-rc1 但views2-rc1 非常不穩定說,有可能將drupal 的數據破壞
直接从数据库查询吧
直接从数据库查询吧。
http://drupalchina.org/node/4311
------
博客 | 瞅瞅
------
Blog
大致看了一下這篇文
大致看了一下這篇文章
<?phpecho '<h2>最新story</h2>';//标题随意
$result = db_query_range("SELECT n.nid, n.title FROM {node} n WHERE n.type = 'story' ORDER BY n.created DESC", 10);
while ($test = db_fetch_object($result)) {
echo l($test->title,'node/'.$test->nid).'<br>';
};
?>
其實即是用類似這段php 碼,n.type 就是我創建的staff content type, 比如 ...... WHEREn.type = 'staff' .........
這樣就可以讀取所有staff node type 的 content node, 對吧???