Skip to content

指定した配列から1つ、または複数の要素を取り出した配列を返します。 / Pick one or more random items out of an array.

Notifications You must be signed in to change notification settings

bit-part/mt-plugin-RandomArray

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RandomArray - Movable Type Plugin

Japanese

Overview

Pick one or more random items out of an array.

Prerequisites

  • Movable Type 6.0 or higher (I confirmed it.)
  • Movable Type 5 (Maybe)

Installation

  1. Unpack the RandomArray's archive.
  2. Copy the "RandomArray" directory into /path/to/mt/plugins/

Usage

<mt:RandomArray name="entry_ids" limit="3" setvar="random_ids">

Attributes

name (required)

The name of the array.

limit (optional)

Specifies how many items should be picked. Default is 1.

destructive (optional)

This attribute is destructive. The original array is altered.

Basic Example

<mt:Entries tag="foo" limit="20">
    <mt:SetVarBlock name="entry_ids" function="push"><mt:EntryID></mt:SetVarBlock>
</mt:Entries>
<mt:RandomArray name="entry_ids" limit="3" setvar="random_ids">
<mt:Entries id="$random_ids">
<mt:EntriesHeader>
<ul>
</mt:EntriesHeader>
    <li><mt:EntryTitle escape="html"></li>
<mt:EntriesFooter>
</ul>
</mt:EntriesFooter>
</mt:Entries>

MT::Lover::bitpart

About

指定した配列から1つ、または複数の要素を取り出した配列を返します。 / Pick one or more random items out of an array.

Resources

Stars

Watchers

Forks

Packages

No packages published