Skip to content

salscode/RandomChunk

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

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`!]

About

RandomChunk randomly outputs a chunk from a list of chunks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages