Skip to content

Latest commit

 

History

History
7 lines (5 loc) · 563 Bytes

File metadata and controls

7 lines (5 loc) · 563 Bytes

RandomChunk is a MODX snippet that provides a simple and efficient way to randomly generate one chunk from a list of chunks. The snippet only takes one parameter which is equal to a comma delineated list of chunk names. An example call is below.

Installation

Copy and paste the snippet code into a new snippet called "RandomChunk". Then simply call the snippet anywhere you would like to generate a chunk randomly. Since the snippet delivers content randomly, an un-cached snippet call is the way to go.

Usage

[!RandomChunk? &chunks=`chunk1, chunk2`!]