View Single Post
Old 12-02-2010, 08:29 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Code submitted.

There is now a template function 'count'. It takes one argument, the character that separates the items in the list. Most lists use comma, but authors uses ampersand.

Examples:
tags: {tags:count(,)}
authors: {authors:count(&)}
a custom multiple field: {#mymult:count(,)}

As another example, imagine that you have a custom field #genre that you use for hierarchical tagging. This would be a text (non-multiple) field containing things like
Science:Biology:Plankton
Fiction:Mystery:Crime:Police
You can count these via
{#genre:count(:)}

Last edited by chaley; 12-02-2010 at 09:18 AM.
chaley is offline   Reply With Quote