[pmwiki-users] (:toggle:) & unique number

The Editor editor at fast.st
Wed May 9 11:17:51 CDT 2007


On 5/9/07, noskule <noskule at gmx.net> wrote:
> hi list
>
> I'm building a issues/comment/xxx list and stuck cause I cant figure out
> how to generate/use a unique identifier.
>
> See this:
> [[#Item]]
> {=$:Heading} (:toggle div=Description-<UNIQUENUMBER> lshow="$[Show
> Description]" lhide="$[Discard Description]" init=show:)
>
> >>id=Description-<UNIQUENUMBER><<
> {=$:Description}
> >><<
> [[#Itemend]]
>
> Does anyone have an Idea how to replace <UNIQUENUMBER> with a reel
> unique number. Vor the beginning {(rand 0 1000)} would work to, but how
>  do I get the same number in the toggle AND the div


You could consider setting up a page variable in your config file to
generate your unique number and insert it wherever you need it.  I
like to use timestamps for these kind of things

$FmtPV['$id'] = "'" . time() . "'";

Then in the page {$id}

But why don't you manually just type these in? Are you somehow
generating these automatically?  Do you need multiple unique numbers?
I'm not sure I fully inderstand your objective, so my suggestion may
not be the best.

Cheers
Dan



More information about the pmwiki-users mailing list