WordPress有个插件(Random Articles Wordpress Plugin)可以实现随机文章区块。Drupal好像没有随机文章(Random Articles)模块,那么Drupal怎么实现随机文章区块呢? 其实很简单,用View就可以实现随机文章。只要在Sort Criteria里面选择添加 Global: Random排序条件即可。 下面就是随机排序设置的截图: . f0 \1 X! U0 B' f2 ] C) v& v

Drupal Ramdon Articles 设置步骤:
k6 F( ~) ]4 S) M/ ?% U7 _9 w1 s1.create a new view in administer » views » add tab. 在administer » views » add tab新建一个views 4 ~, W4 N" B( v# F
2.give it a name. I called mine "Random"." C! P% @8 J- B2 Y2 K, `9 i
命名,我用的名字是"Random".
9 G+ I$ ~! j3 f
, \0 P* U& ], e7 A3.click the "Block" section heading to get its settings.
% N2 g2 Y2 M2 ^1 e- R/ E点击 "Block"部分的标题,以获得其设置。
1 ]. B5 a3 G7 p1 O& O4 C8 }7 o# f5 r) S# K/ m. @. m5 I0 b
4.enable "Provide block"$ t6 }7 e! V* |
启用"Provide block"% G8 m* ?9 j; [. b) |
. ~" ?+ C! O+ s( e: h! }. e
5.choose a "View type". I went with "List View" so that I could choose which fields display in the block.9 C+ [ h1 F5 a* V! o: o$ X. ]1 ?
选择一个“View type 视图类型” 。选的“List View 列表视图”,这样我可以选择在哪些领域显示块。% ~& @" |+ t3 a6 K2 ]' V4 x
. `: m* H+ u5 A" R1 ~: c* R
6.type in a title. This will be the title of the block.' f' E3 [& D8 S4 U- Z
键入标题。作为Block块的标题。9 a' C# ]: A9 j0 ^
" X; X( T+ k; K# Y1 e
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.
7 W3 n. @3 E/ F1 p" Z! X在您想要显示的块节点上键入一个数字值。如果你愿意,你可以用1 (数字1) 。
) y- `& ^+ x+ T& X( q! b
0 s" y( U$ z% v
! `* ^* S C# {* H6 q5 f* M9 q6 {( e8.click the "Fields" section heading to get its settings.
" M3 e; l ?, \% X$ b单击“Fields字段”部分的标题,以获得其设置。
, `( J a! r2 V; g7 i
' H5 i( o! Q9 _. h9.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. x8 c1 \9 Y4 [5 N
添加你想要的Fields领域。我只是选择“Node: Title节点:标题 ”因为我想只是链接到的节点,而不是节点的文本本身。你应该能够选择任何领域有报价在CCK的节点。9 E$ `- _1 c; s% O; H
: k8 _4 q/ S% T* E# R) y
10.click the "Filters" section heading to get its settings.6 `% q( W" H4 c! J1 F% s
点击“Filters过滤器”一节的标题,以获得其设置。
$ `9 X/ r( W" I( S$ @+ j
' I9 [$ @1 E, N' S! K11.select "Node: Type" and click "Add Filter"
3 p* z4 Z9 }+ D# g# S* ?选择“Node:Type节点类型” ,然后点击“添加Filter过滤器”
]" B& Y' |* o9 |4 L3 X
* i, v d, c7 p' p" Y) \/ J+ u12.choose the CCK node type(s) you want to appear in the block.
, G4 e2 b; t4 R/ v, J选择了CCK节点类型type(S)你要出现在块。4 x6 Q2 d$ K& f' H
! }# v7 u/ a1 P
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.
1 G; A% G" Z$ v5 L/ t6 N9 z+ b, @选择“Node:Published节点:发布” ,点击“添加过滤器Filter”。(我一直忘了这一个,但它是重要的,因为你可能不希望显示未发表的节点。$ l7 Z4 l, Z& l3 Y
. K; G4 u# z1 U# G- a, }14.click the "Sort criteria" section heading to get its settings.
+ U9 `# X$ y$ V: ]8 t3 v% m* _点击“Sort criteria排序标准”部分的标题,以获得其设置。' {# x; z% |4 Y7 ~. G8 t
8 K7 {) z" s& n1 h2 D8 \
15.select "Random" and click "Add criteria".
6 H$ L" I8 U5 s: H& [( K$ I选择 "Random",点击 "Add criteria".
1 o2 V# ?/ j0 Z0 j+ [
! H: U$ w% P R3 g16.click "Save"
4 n* X% p, x" F6 f9 c' q8 E2 ~6 j点击保存! S# _2 r" I% w$ |
) e3 @& j6 v3 l$ P; g7 [6 E. e
17.click administer » blocks and enable the block you titled in step #6.1 H7 x) }# v/ u
点击administer » blocks,并启用第6步设置标题的Block快。; f( D- `/ K' K9 l6 _5 w
& t- f. {/ \0 }" n9 Q4 |$ W( _# {
----------------------------------------------------------------------------------------------9 t/ _' H* _+ J' n* y
9 s$ B* Z- \: p4 o0 _ \DOOOOR国外设计论坛 www.doooor.com---Howfar翻译!转载请注明,谢谢!
, U: R- s+ p. t" f
1 F2 g- L9 l5 u% C" w6 G8 j8 n$ e z
. C2 d- J" @/ M% @
3 K$ d' S7 {. _8 B6 r' r9 j
|