Drupal 是一套開放源碼的內容管理平台,擁有多種實用的功能,可以用來建置從個人網誌到大型網路社群等各種類型的網站,例如華納唱片、紐約觀察報、Fast Company、Popular Science、SonyBMG、富比士、哈佛大學等網站,或是個人部落格(Tim Berners-Lee)、播客網站(TWIT.tv)、線上社群(SpreadFireFox.com)。
Drupal 是一套開放源碼的內容管理平台,擁有多種實用的功能,可以用來建置從個人網誌到大型網路社群等各種類型的網站,例如華納唱片、紐約觀察報、Fast Company、Popular Science、SonyBMG、富比士、哈佛大學等網站,或是個人部落格(Tim Berners-Lee)、播客網站(TWIT.tv)、線上社群(SpreadFireFox.com)。
Re: views 的 arguments 是怎样搞??
小弟用5.x 版的Views
arguments 就是你要傳入什麼變數
Step1. Create Views
Step2. 勾選 Provide Page View
網址就填入 $arg/anystring ($arg 就是指要傳入的變數)
Views 的顯示方式就不多說了
Step3. Argument Type -> 選擇 Term ID -> Add Argument (表示你要傳入的是分類的 ID )
這樣就OK了~ 要測試的話就可以用
5/anystring => 分類ID 5 的顯示出來
29/anystring => 分類ID 29 的顯示出來
Re: views 的 arguments 是怎样搞??
謝謝!!!!我在drupal 5.x 跟着做也行
我在view 的block 设了之显示3个node, 但出来的效果是全部node也显示
一下是那段code
<?php
$view = views_get_view('raw_block');
$abc= 'Jasper';
$myview_args = array(0 => $abc);
print views_build_view('block', $view, $myview_args, false, false);
?>
Re: views 的 arguments 是怎样搞??
是 term id ~
然後就可以用 raq/11 看到了
Re: views 的 arguments 是怎样搞??
我一定要用term name 的 不过也解决了
不过block设了只显示3个node, 但最终是所有node也显示出来
是什么问题?
Re: views 的 arguments 是怎样搞??
附檔是我的設定
Re: views 的 arguments 是怎样搞??
3 個 node 是指什麼 ??
你只允許出現三列 ??
還是指只允許 三種 node type ??
Re: views 的 arguments 是怎样搞??
3个node是只出现三列 (即是就算工有20个node content, 也只会显示3个)
另外我还设了sort 做random, 但效果没有random 显示出来
Re: views 的 arguments 是怎样搞??
在block tab 內設定 node 數為3?
Joetsui's blog
Re: views 的 arguments 是怎样搞??
是的
Re: views 的 arguments 是怎样搞??
設定Block 的畫面傳上來看看~
還有你的網址列是打什麼
http://localhost/?q=raw/分類名字 <== 這樣嗎 ??
Re: views 的 arguments 是怎样搞??
http://i36.photobucket.com/albums/e28/adrianmak2/Snap2-14.jpg
Re: views 的 arguments 是怎样搞??
哇~ 圖太小了啦~ 完全看不清楚~
Re: views 的 arguments 是怎样搞??
图更新了
Re: views 的 arguments 是怎样搞??
設定 3 個的話~ 就應該要顯示 3 個才對~
你說你顯示不止 3 個 ?
Re: views 的 arguments 是怎样搞??
是啊!! 会否用php code 来读取views block , 这个设置就不生效?
Re: views 的 arguments 是怎样搞??
你是如何使用那個 Block 的~ 詳細說說看~
Re: views 的 arguments 是怎样搞??
在 node-product.tpl.php template 里面用一下这段php code
product 是自建的cck content type
<?php
$view = views_get_view('raw_block');
$abc= 'Jasper';
$myview_args = array(0 => $abc);
print views_build_view('block', $view, $myview_args, false, false);
?>
Re: views 的 arguments 是怎样搞??
在node-product.tpl.php
<?php phptemplate_comment_wrapper(NULL, $node->type); ?>
<?php if ($page == 0): ?>
" title="<?php print $title ?>"><?php print $title ?>
<?php endif; ?>
<?php
$path = drupal_get_path_alias($_GET['q']); //get alias of URL
$path = explode('/', $path); //break path into an array
//print $path[0];
$view = views_get_view('raw_block');
$args = 'Jasper';
$view_args = array(0 => $args);
print views_build_view('block', $view, $view_args, false, $limit=3, false);
?>
但server 就出现error。
Connection Interrupted
The connection to the server was reset while the page was loading.
The network link was interrupted while negotiating a connection. Please try again.
其实是想在product node page 时, 在现实另一个views 的
请问是什么问题? 是不是node page 内不能显示另一个views ?
同一段php code, 放在一般content body内( ie php input filter) 是可以正常执行的
Re: views 的 arguments 是怎样搞??
你的網站建構的如何了?
我也相同的問題
Re: views 的 arguments 是怎样搞??
drupal6 view2
找不到Provide Page View