How to NOT display Titles on Static Pages in Drupal

This is basically a way to style elements according to what kind of node they are in. So a title in a book page will look different than a title in a story.

This is based on some code written by Erik Hopp as shown in This thread
The idea is, we want each element to have a style assigned to it that not only makes a distinction between the ELEMENT type but the NODE type the element is in. So for example, instead of a title being styled only as

   <h1 class="title">This is the Title of a Static Page</h1>

we want the class name to specify that this title is within a “particular” type of node.

        <h1 class="title-page">This is the Title of a Static Page</h1>
or
         <h1 class="title-story">This is the Title of a Story</h1>
Continue reading

Passing a variable to any page by clicking a link

I am working on a game which requires people to log in by selecting whichever team they are on. Each team is made up of several departmental units.

People probably won’t know what team they belong to the first time they play. There is no list of all the potential players, so it isn’t possible to automatically associate users with teams.

So we constructed an entry page which lists all the departments and which teams they belong to. People find their department, and are automatically associated with a team.

It required creating a little script to pass the name of the team along to the game login page.

Presumably people WILL know what department they are in, and will be able to select their team in that manner.

The problem was, the team name has to be passed to Questionmark Perception’s login page, since it requires the team name to send whatever points are earned to the appropriate team.

I used the following javascript to set a hidden field “GROUP” on Questionmark’s login page, when a player clicks the team link on the Entry page.

Continue reading

Scroll wheel changes selection in drop-down menus

In some of the Questionmark quizzes I’ve made there are “selection” questions, which are simply pull down menus with several possible answers to a question. I started getting emails from scroll wheel users complaining that Questionmark was changing their answers.

It turned out users would make a selection, then immediately start scrolling the wheel without deselecting the menu, so the scroll wheel would scroll within the menu. I didn’t want to disable the scroll wheel or something like that, so I looked for a way to jump the cursor out of the menu when something is selected.

Continue reading