WordPress有个插件(Random Articles Wordpress Plugin)可以实现随机文章区块。Drupal好像没有随机文章(Random Articles)模块,那么Drupal怎么实现随机文章区块呢? 其实很简单,用View就可以实现随机文章。只要在Sort Criteria里面选择添加 Global: Random排序条件即可。 下面就是随机排序设置的截图:
( B, A& M. J! S% [- X* B
Drupal Ramdon Articles 设置步骤: + `0 I, X. V( ?& D8 B
1.create a new view in administer » views » add tab. 在administer » views » add tab新建一个views
+ p; v% X% p9 a s8 a e0 L' E2.give it a name. I called mine "Random".
6 v4 K" x, E8 d6 M9 G' ^命名,我用的名字是"Random".
: J4 ~3 u3 h$ z5 x+ s) ~0 k6 Z8 b: r. _ s
3.click the "Block" section heading to get its settings.6 O4 W6 `. F$ e" `! R9 z
点击 "Block"部分的标题,以获得其设置。" t# m1 I# E) l; n, a4 F5 @
0 }0 r9 W1 }& v! a E7 t
4.enable "Provide block"
4 y g P$ }2 z! r7 h; k启用"Provide block"9 m' c/ Q* k- _ s
8 z# }. k: a, Y* J: n" ^3 P8 A1 o
5.choose a "View type". I went with "List View" so that I could choose which fields display in the block." j/ G6 P. b8 O' a* D% u
选择一个“View type 视图类型” 。选的“List View 列表视图”,这样我可以选择在哪些领域显示块。6 W8 k8 v7 Q0 U% C2 r
0 E( u: X& Q8 h, H. W
6.type in a title. This will be the title of the block./ _/ h3 ]+ @6 e2 S; I
键入标题。作为Block块的标题。* p4 \" G3 D5 x, X& [/ H
9 L* z) s( r+ w: O
7.type in a number for the amount of nodes you want to display in the block. You can use 1 (number one) if you like.
9 P5 g. }3 V+ N/ k! {" Q在您想要显示的块节点上键入一个数字值。如果你愿意,你可以用1 (数字1) 。
7 F1 I: Q" y: @3 [* G& t! c( R, V `7 z0 O* ^4 _5 Y
0 A- j* s1 y/ D1 H# n8.click the "Fields" section heading to get its settings.
8 s( \" b1 F4 q% Z单击“Fields字段”部分的标题,以获得其设置。; `! \2 {& C G
2 w* y. m! y- ^% _# @
9.add the fields you want. I chose just "Node: Title" since I wanted just links to the nodes, not the node text themselves. You should be able to choose whichever field has the quote in your CCK node.
& e( c% H' I1 l+ k* ~添加你想要的Fields领域。我只是选择“Node: Title节点:标题 ”因为我想只是链接到的节点,而不是节点的文本本身。你应该能够选择任何领域有报价在CCK的节点。
, P) m/ ]8 f! D" w5 a. c5 ?5 u: O8 L5 B. e* u, d6 L) ^
10.click the "Filters" section heading to get its settings.
- s! l, ]1 @4 b2 v; T2 _4 \点击“Filters过滤器”一节的标题,以获得其设置。
" A3 L+ H9 |* J; f& ~2 K$ D4 U$ P
$ J, j$ t5 l" j# l3 \11.select "Node: Type" and click "Add Filter"2 d% A" r1 t4 m' [$ Z
选择“Node:Type节点类型” ,然后点击“添加Filter过滤器”
2 X/ \: r1 _% O! Y" {
- T# @# M5 r2 \0 d( {8 E$ X; V/ ^$ j* i12.choose the CCK node type(s) you want to appear in the block.
- v* e& p1 u. G! C4 q5 d选择了CCK节点类型type(S)你要出现在块。7 ]' T' f# d" P' m$ I
+ r* H; N( Z! n' p8 G3 N
13.select "Node: Published" and click "Add Filter". (I keep forgetting this one, but it's important, since you probably don't want to display unpublished nodes.
: t, w: F1 x, `" e/ D3 \) \0 a" `3 w7 Q选择“Node:Published节点:发布” ,点击“添加过滤器Filter”。(我一直忘了这一个,但它是重要的,因为你可能不希望显示未发表的节点。
5 v) Y7 {/ e, ]: ?- j: q; i# J# \$ V6 \4 O, l
14.click the "Sort criteria" section heading to get its settings., |3 y1 Q/ s9 M0 Y0 b* o
点击“Sort criteria排序标准”部分的标题,以获得其设置。
* N7 Q6 d9 ^6 t5 } f7 U, a
: x+ d5 T( V2 H' ~+ |& N15.select "Random" and click "Add criteria".
& A. X! k& B" v" C6 `# z. h9 C选择 "Random",点击 "Add criteria".; m2 X1 |# \( _& z
3 | L% T# s) N) m5 z
16.click "Save"
: B7 Y- g& _0 G$ `4 y K" o( E点击保存
* U& N, h/ p3 s4 Q8 G- n$ W5 r8 G' }* ~
17.click administer » blocks and enable the block you titled in step #6.! S& b$ \/ `+ b0 o
点击administer » blocks,并启用第6步设置标题的Block快。
% y9 _/ U7 s8 x6 ~4 V
3 r3 v2 O1 F4 T2 _0 M1 I---------------------------------------------------------------------------------------------- h* l: ~, V/ z) Y' s- T0 ~
! s) g2 a( r2 M- |% ]* |& xDOOOOR国外设计论坛 www.doooor.com---Howfar翻译!转载请注明,谢谢!2 v+ T8 \+ q2 `6 o$ L
. k$ J7 E# i) [
4 d! Z7 u$ i: M/ @3 [9 ]5 ^' d
! j. a" P8 X2 h' E1 _$ K3 \) x0 b! }& \
|