|
WordPress有个插件(Random Articles Wordpress Plugin)可以实现随机文章区块。Drupal好像没有随机文章(Random Articles)模块,那么Drupal怎么实现随机文章区块呢? 其实很简单,用View就可以实现随机文章。只要在Sort Criteria里面选择添加 Global: Random排序条件即可。 下面就是随机排序设置的截图: ) C2 l, `/ a! M( i0 s3 G8 S

Drupal Ramdon Articles 设置步骤:
X9 V. m% G) h( l1 y1.create a new view in administer » views » add tab. 在administer » views » add tab新建一个views
3 C: ?7 e, Z* \, O3 k* B2.give it a name. I called mine "Random".
# ?" I) O* y9 F; I V5 [3 {& D命名,我用的名字是"Random".
. H3 i) ?6 V. _% |+ i1 P2 N3 e8 ^0 t% \9 N' J2 a
3.click the "Block" section heading to get its settings.
$ q" J) ^2 G6 w点击 "Block"部分的标题,以获得其设置。
* R; ~) J! f4 H7 F) c3 E! O W! D& F/ K
4.enable "Provide block"
2 i$ O5 d4 N# f9 W启用"Provide block"
9 X9 u [6 ? `7 g+ W2 |
, J X9 G5 q# ?5.choose a "View type". I went with "List View" so that I could choose which fields display in the block.3 j$ _& c" b. q( E1 Y, Y
选择一个“View type 视图类型” 。选的“List View 列表视图”,这样我可以选择在哪些领域显示块。
/ L1 J4 M2 n$ }: t% Y- J
% @3 W% u$ ^: K6.type in a title. This will be the title of the block.3 B# A: b& X5 K* | y+ `$ A1 u
键入标题。作为Block块的标题。
( K8 _/ E3 e4 {2 X1 i
3 D! L3 n& r. z: L" X! \6 d7.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.
! D" t2 b' K) [$ P5 Q# H N在您想要显示的块节点上键入一个数字值。如果你愿意,你可以用1 (数字1) 。' z& ~& h0 I; h5 S2 _8 B: g
, i3 y4 w% v: `# X/ y" I8 N- r5 w( W8 v7 A4 H5 H$ b5 _/ U& s2 c
8.click the "Fields" section heading to get its settings.
/ J* V3 y: `, o; l( a% L单击“Fields字段”部分的标题,以获得其设置。 J( r; p$ J6 \( q8 z0 L# ]
) Z! Z* }# }" J( R Q
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.
6 ? ~4 N, I4 l* d0 s添加你想要的Fields领域。我只是选择“Node: Title节点:标题 ”因为我想只是链接到的节点,而不是节点的文本本身。你应该能够选择任何领域有报价在CCK的节点。; w1 C$ t, k; k
9 L; Z0 q4 ]9 \7 l0 g4 a# @
10.click the "Filters" section heading to get its settings.
9 E0 _; e/ S+ U! U! ~" {点击“Filters过滤器”一节的标题,以获得其设置。) i/ a3 E: O2 f ~0 |9 q7 i4 v
/ A" L# h" `. T7 ?11.select "Node: Type" and click "Add Filter"
8 P& n! r9 c+ t k选择“Node:Type节点类型” ,然后点击“添加Filter过滤器”
- S4 M7 z- }% u: t" O/ v) T; B- V5 `! u, Z+ H
12.choose the CCK node type(s) you want to appear in the block.
! m% v1 |5 \7 E- g. X+ p1 A9 u选择了CCK节点类型type(S)你要出现在块。
p4 { V8 s) ]- f1 I2 D- ]
+ T, t5 H' W* @" D0 u9 Q' l13.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.! ^- H: o/ E8 n% O0 n
选择“Node:Published节点:发布” ,点击“添加过滤器Filter”。(我一直忘了这一个,但它是重要的,因为你可能不希望显示未发表的节点。1 m* C6 m2 |# V4 w Y8 Q
6 x4 y; \$ ~4 R14.click the "Sort criteria" section heading to get its settings.
: c. O- @1 P/ v点击“Sort criteria排序标准”部分的标题,以获得其设置。# [) z0 u& C; ^) z! f$ w$ t$ T7 d: O
4 T1 T6 m1 N5 u15.select "Random" and click "Add criteria".$ [( q3 j# ^2 Q" u/ X8 T
选择 "Random",点击 "Add criteria".
9 b, W# P5 v& A4 Y6 r1 q) C) h3 p4 w
; o' R* d4 M, R# [2 W16.click "Save" F% [$ o6 [# u
点击保存3 S* D/ V) U/ E3 w% i) I0 W
6 K9 g# D* u! x& R% t3 D3 ~0 C
17.click administer » blocks and enable the block you titled in step #6.- k( `. K% B. u9 p9 s* ^
点击administer » blocks,并启用第6步设置标题的Block快。
& R1 Q3 Q, k% D0 k; e# k7 C a( ^
: U0 C4 G( X4 s" U8 U" P5 ?----------------------------------------------------------------------------------------------
3 u5 Q: u" v: U" V6 ]( f% ]6 J; o+ Y; k$ i) H" U* W
DOOOOR国外设计论坛 www.doooor.com---Howfar翻译!转载请注明,谢谢!4 p; y* v" L$ p" v% o2 Z
% i, R4 ^7 v) \" c2 ?0 f8 r7 [' q$ s9 r
# H5 [* R6 S( ~5 e' Q
1 t; z/ d9 u) X* a5 u |