I would like to have a token like [rand] that give me a random number ?
For different number of digits maybe [rand1] , [rand2] , [rand3] ... can be used to give a random number of 1 , 2 , 3 .. digits respectively ?
Thanks!

Comments

greggles’s picture

Title: random number token to use with pathauto » (pseudo) random number token
Project: Pathauto » Token

This one probably actually belongs in token ;)

Also, I guess we could make it 1 digit long and then people could stack them together to make multiples?

Maybe providing some big groups like a [rand1] and [rand3] and [rand5] could allow people to stack them in a way that work reasonably well.

One real problem with these tokens is that the token module caches the token data for performance reasons, but if the rand values are cached that would defeat the point of the randomness. I'm not really sure how to fix that...

yell0w’s picture

I guessed a one-time-used random token would be more accurate description of what I need. Or a random nid attached to a node ?
The reason I ask for this is that I want a random 3 digit number to become sort of a 2nd nid for each node, that I can use with pathauto instead of the incremental value of nid. The randomness is only needed at the time of URL/alias creation. After that then it can be cached, etc...

greggles’s picture

Status: Active » Closed (duplicate)