[pmwiki-users] (:toggle:) & unique number
noskule
noskule at gmx.net
Wed May 9 11:45:35 CDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The Editor schrieb:
> 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?
hmm, I made a testpage see:
http://netstreams.org/test/pmwiki/index.php?n=Extensions.ToggleInPageLists
So I need a unique number for each entry that the pagelist generates.
the problem is that I need two times the "same" unique number. One time
in the toggle directive and in the divesection, see code above.
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
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGQfqvrGF5npnsxVgRAlYgAJ9jerUDw4ODe/K5Dg6oty4wRsKm2ACcDrFB
ky67gW8xRRKtl5MiEiN6R6Y=
=OKf7
-----END PGP SIGNATURE-----
More information about the pmwiki-users
mailing list