[pmwiki-users] Zap: Listfmt

The Editor editor at fast.st
Wed Jun 6 07:32:16 CDT 2007


On 6/6/07, noskule <noskule at gmx.net> wrote:
> hi dan & list
> I try to add a category field to a form. So the user could categorize
> the content for a glossary term.
>
> The field would contain:
>    Category 1, Category 2, Category 3
>
> I save the data with the variable "Categories", and show the Categories
> with {$Categories}:
>    Category 1, Category 2, Category 3
>
> But what I have to do to get links?
>    [[!Category1]] [[!Category2]] [[!Category3]]
>
> I did a search on the documentation and it seams that the list and
> listfmt is for that. But listfmt is an empty page.
>
> Could you give me an example for this?

Bummer. Not sure what happened to the listfmt doc page. Maybe I never put it up.

To get the display you do this (this uses a pipe for the separator):

{(list {$:Categories} "[[!{item}]] ^ | ")}

However, unfortunately it won't produce the category effect which is
probably what you want. Because, one the category link is only created
dynamically when the page renders, it's not actually in the page
markup, so it won't be counted as a category link. Two, even if you
put the entire link in the PTV, it still won't work as category links
there also do not count as a category link.

There's not currently an easy way to do this. I've tinkered with it
some, and gave up a while back. Maybe we could revisit it. Though
neither are attractive, the solution is much easier if

1) You don't need to be able to edit the category list
2) You limit or somehow set the number of categories on each page.

Another option might be to simply bypass the Category system and use
some kind of pagelist that checks for values in a PTV.

Perhaps someone else has an idea for how to do what you are wanting.
If someone can explain a strategy to make it work, we can probably get
it done in ZAP.

Cheers,
Dan



More information about the pmwiki-users mailing list