Movable Type

Call of Cthulhu Knights of the Dinner Table Online

Here is an example of its use:

  • :
  • Arguments:
  • <MT>

    Version :

    ChangeLog:

    « MTEntry | Main | How To Prevent Link-Rot in Movable Type or How To Easily Link To An Entry »

    May 29, 2003

    MTSplitLoop

    Tags Provided

    As with other plugins , I've been meaning to write and release this one for quite some time, and I've only now actually done it. So, here is one of the most useful text parsing functions in Perl, wrapped in a Movable Type plugin: MTSplitLoop.

    For those unfamiliar with the split function in Perl, here is the quick description taken from the split documentation page at Perldoc.com

    Splits a string into a list of strings and returns that list.

    In other words, given a string "A,B,C,D,E,F" and the pattern "," to split based on, split returns "A", "B", "C", "D", "E", and "F" so you can process each portion of that string by itself.

    Download one of the following files, unpack it, and place splitloop.pl in your plugins/ directory.

    The following tags are available:

    Usage Example (with Brad's Key Values plugin):

    <MTIfKeyExists key="files">
    <p>File List</p>
    <ul>
    <MTSplitLoop value="[MTKeyValue key='files']">
    <li><MTSplitLoopValue></li>
    </MTSplitLoop>
    </ul>
    </MTIfKeyExists>

    Comments and Trackbacks

    1. This is exactly what I needed, thank you.

      No problems with crashes, or slow time.

      I would, however, modify your example to include the container tag -- I copy-and-pasted your example and struggled to get it to work, until I realized this slight oversight.

      Thanks again.

      Posted by: S"Y on January 4, 2006 05:11 PM

      SplitLoop

      Similar to the Perl split command....
      Trackbacked from MT Plugin Directory on June 5, 2003 05:29 PM
    Post a comment









    Remember personal info?






    Outgoing Pings

    Related Entries

    Related Pages (via Google)

    David Raynes: MTSplitLoop

    David Raynes: MT Plugins Archives

    David Raynes: MTEntry

    David Raynes: How To Prevent Link-Rot in Movable Type or How To ...

    David Raynes: How To Prevent Link-Rot in Movable Type or How To ...

    David Raynes: Movable Type Archives

    David Raynes: Movable Type Archives

    Movable Type Community Forum > Headline and subhead in MTEntryTitle

    Six Apart ProNet - Plugin Directory - SplitLoop

    Movable Type Plugin Directory: SplitLoop

    Trackback Me?

    TrackBack URL for this entry:
    http://mt.rayners.org/mt-tb.cgi/206

    Want To Say Thanks?

    Amazon Wish List

    Think Geek Wish List