Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: count number of article images
Gocom wrote:
I would discourage calling tag functions directly. Its way more likely that the function will be gone, than the parser or the syntax changes. As long as PHP doesn’t reserve parser as function or keyword.
Thanks, reverted the code to parse
(but AFAIK, name="article_image"
is undocumented)
The only documented way of accessing the tags is by template strings, or querying the registry.
Querying global variables (or the registry?) is much faster than calling the parser, I hope future versions will still allow it.
"id IN ('".implode("','", $ids)."')");
I have shamelessly borrowed it from some txp function. :)
Offline
Re: count number of article images
I didn’t think to search for this thread the other day when I was trying to figure this out. But I did come up with a method using adi_calc.
<txp:variable name="images-count" value="0" />
<txp:images form="images-count" break="" />
and for the images-count miscellaneous form:
<txp:adi_calc name="images-count" add="1" />
Offline