Re: [Tiki-devel] Counting items resulting from items > item list (smarty ?)

Jean-Marc Libs <[email protected]>
Newsgroups gmane.comp.cms.tiki.devel
Message-ID <CA++RN4dXNQDLZq=yknZEPwBdpFbD4Cjx8xn50JuHQrJPKmZpdg@mail.gmail.com>
Some thoughts lower (nothing tested)

On Mon, Mar 15, 2021 at 5:43 PM Bsfez Tiki via TikiWiki-devel <
[email protected]> wrote:

> Thanks Jonny,
>
>
> I kept my list plugin as is (was working with the
> templates/search/list/count template) and create a smarty template with the
> code you posted.
>
> phpStorm doesn’t like the ":count" and I have a syntax error.
>

Have you tried "|count" instead of ":count"?


>
>
> But this is outputting the items count (13) not the names count (15)
>
> Then I recheck each field and find out that on Tiki22 the output of a item
> link field is a… token.
> Here the value I have for an item with 3 kids:
>
> *tracker_field_productsboughtChildName* => "tokenyvvbvdfbvbzxpyccpzvttbearppucfqz..."
> *tracker_field_productsboughtChildName_text* => "גפן, מרום"
>
>
>
I have found that the token thing is usually an array, and adding this line
:
{FORMAT(name="something")}{display
name="tracker_field_productsboughtChildName" format="trackerrender"
default=""}{FORMAT}
will convert tracker_field_productsboughtChildName into an array. *Then*
you can count the number of items. No need to use variable "something" for
anything.

Cheers,
J-M

_______________________________________________
TikiWiki-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.