Wizard/Help popups

Wizard/Help popups

by John Papaioannou -
Number of replies: 4
Hi all!

Lately I 've been leisurely working on a "wizard popups" feature. It seems that we 'll be stepping up the pace on this one, so I figured this would be a nice time to get some feedback of the feature...

Let me attempt to explain what exactly is going on.

  • We 're talking about popup windows which display inside the browser window, when you load a page. Javascript required, but the feature will be completely cross-browser.
  • Popups can be targeted at a specific visual element on the page. If targeted, they will display pointing to that element, scrolling the window so that the element is visible if needed. If the element does not exist, they will not display at all. (This is necessary in order to point to e.g. course blocks, whose position we cannot take for granted).
  • The popups get activated depending on a variable and configurable number of clauses, all of which must be satisfied.
  • You can assign multiple popups to the same set of clauses, and while only one of them will display at any one time, you can make them link to one another in any way you wish. Thus, clicking a link in a popup text could close this popup and display another. Popups assigned to the same set of clauses are a group.
  • Groups of popups normally get displayed only once to each user. However the code is flexible and we can arrange for this behavior to change according to circumstances ("I am an experienced user and I don't want to be bothered!")
  • There has to be a user interface feature somewhere which you can use to craft popus, create new groups, customize their text, etc etc. This implies storage in the database.
  • The popups have to be multilingual. This implies storage in language files.

Keeping the above in mind, let's see what tools you have to aid in the creation of such popups:

  • You can use part of the url as a clause.
  • The popup engine provides you to a number of variables which you can try to match as a clause (this will become clear in a while).
  • You can use any or all of the request variables as clauses.
  • The user interface will have options to export to and import from language files. This will allow anyone to create nice sets of popups and then export them to language files so that they can be passed around.

For example, you can create rules like "show this popup if: 1) we are viewing course/view.php and 2) the user is a student in this course". The last part is what I was referring to as a variable provided by the popup engine. Variables implemented right now are: admin status, teacher status (per course), editing teacher status (per course), student status (per course), guest.

The good news is that I 've got pretty much all of this working right now except the user interface. tongueout

So... I 'd like to hear your thoughts on this. How it might be helpful, where it might be used, what would you like it to be capable of, what you might think to do with it, anything! Just go ahead and brainstorm! big grin

Cheers!
Jon
Average of ratings: -
In reply to John Papaioannou

Re: Wizard/Help popups

by Gustav W Delius -

I have seen this in action at the developer's online conference and was very impressed.

When you say that these popups can be targeted at "visual elements on the page" what exactly do you have in mind and how would one specify this?

In reply to Gustav W Delius

Re: Wizard/Help popups

by John Papaioannou -
Basically any HTML element, which you would specify by its "id" html attribute. (There is this very basic and very handy JavaScript method, getElementById()... big grin). I sneakily programmed the blocks and the course sections to have id attributes just after the 1.3 release... wink But you can even place any number of invisible elements in the page (for example, the anchors you use to navigate from the course sections block) and give them ids so they can act as placeholders wherever you want.

As you have seen, the popup calculates the actual and general position of the target on the page. This information is enough to decide where to position itself and where in the balloon to place the pointed end so that the end result looks "natural" to humans.
In reply to John Papaioannou

Re: Wizard/Help popups

by Bryan Williams -

Could a popup be say an entire Moodle activity pulled from another Moodle installation?

In reply to Bryan Williams

Re: Wizard/Help popups

by John Papaioannou -
That's unlikely, but not impossible. The most important points are:

  • A popup has a configurable, but fixed, width. That should be in the "small" league. Makes it difficult to display a whole activity.
  • The content of the popups cannot be (at least now) fetched dynamically from an external source.

What exactly do you have in mind, Bryan?