• MODX.com

    673 downloads

csvToTpl

csvToTpl is an extra by scorchsoft, first released on 2014-10-28.

Package Description

This is the first public version of csvToTpl.

To use this module simply pass it a CSV string along with the tpl that you would like to use to process this string.Simple usage:

[[!csvToTpl? &csv=`my, text, csv` &tpl=`myTpl.tpl`]]

Use a different tpl for a certain item:

[[!csvToTpl? &csv=`my, text, csv` &tpl=`myTpl.tpl` &tpl_3=`myTpl3.tpl`]]

note: the first tpl is &tpl_0

tpl variables:
  • [[+item]] = the item in the CSV array.
  • [[+itemUCFirst]] = the csv item with the first letter capitalised.
  • [[+itemUCWords]] = the csv item with the first letter of all words within it capitalised.
  • [[+itemCaps]] = the csv item with all letters capitalised.
  • [[+itemClass]] = the csv item made lowercase and all non-alphanumeric characters replaced with a hyphen (-).
Example TPL

<div>normal: [ [+item]]<br />ucfirst: [ [+itemUCFirst]]<br />ucwords: [ [+itemUCWords]]<br />caps: [ [+itemCaps]] <br />class friendly: [ [+itemClass]]<hr></div>

Usage/Installation Instructions

To install the extra simply install from within package manager. No databases or unique file structures are required to use this extra.

Details

Developer(s)
scorchsoft
Released
2014-10-29
First seen
2014-10-28
License
GPLv2
Supported databases
MySQL SQL Server
Minimum MODX Requirement
2.2

csvToTpl Releases

Vendor Signature Released on
MODX.com 1.0.1-rc1 2014-10-29 (9 years ago)