Extension instruction: VARIABLE

Status: Implemented

Created by Ed Johnson 20 Dec 2010 13:56

rating: +2+x

**STE **


wdavatar?user=leiger
leiger

20 Dec 2010 14:13. Edited 2 times. (Edit, Permalink)
Yes, I think you're asking for the same thing as me in my other wish/CR.

Although I can change this in future if the need arises, for simplicity I'd prefer to keep everything as two parts only. The "instruction" first on the line, and then some information about how to perform that instruction.

For example:

getinput NAME
append Hello, {NAME}!

With the intention being:

  • Popup a dialog asking for "NAME" (no custom message like 'Enter your name')
  • Post the message "Hello, " and the string that the user entered before.

There would be no limit on the number of variables you can define, and no limit on how many times you can re-use them.

BTW: You might want to rate up your own wish! :) I will rate it up as well, and close my similar wish as I think you've explained it a lot better.

Edit: Just to clarify… the example I posted above is just intended as a first draft of the functionality - keeping it as simple as possible whilst still doing the job it needs to do. As time goes on the instructions can be expanded, adding more options etc. (such as a custom message).

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

20 Dec 2010 23:35. Edited 0 times. (Edit, Permalink)

Restrictions

To prevent people from abusing input dialogs (e.g. asking the user for 500 different things), I want to put a restriction on how many you can use in an extension.

I was thinking that a good limit for now would be 20. Does this sound reasonable?

The ListPages module has 16 possible attributes. So if you ask for the module body in an input dialog as well, that means you'll only need 17. Other modules would need even less. Is there any other use case where more than 20 inputs might be needed?

Included page "inc:signature" does not exist (create it now)

wdavatar?user=
(user deleted)

21 Dec 2010 00:36. Edited 0 times. (Edit, Permalink)
20 seems like plenty, but I'm sure someone will want more at some point. ;) I'd start there and see what happens.

Are you planning to support the same variable used more than once without prompting the user to enter each time it's used?

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

21 Dec 2010 01:53. Edited 0 times. (Edit, Permalink)
Yes. You can read/write the same variable over and over, as many times as you want.

The variable is only forgotten after the extension finishes running.

Included page "inc:signature" does not exist (create it now)

wdavatar?user=leiger
leiger

24 Dec 2010 01:23. Edited 0 times. (Edit, Permalink)
Implemented in STE Version 3.22!

Included page "inc:signature" does not exist (create it now)

Post Reply

Add reply on "Extension instruction: VARIABLE"

CSS Theme, Images and Code on this website are © Shane Smith 2010-2012. All forum posts by users and documentation licensed under Creative Commons BY-NC-SA 3.0 License.