Menu Handlers

In addition to the core menu system described above, the menu files can also optionally contain a virtual sub-menu of handler directives - these inform applications using this particular menu of the preferred applications for handling certain types of objects. Simply put, it allows the regular Wacs applications to better integrate with the rest of your environment by using your applications instead of the standard ones. This was originally developed as a way of re-using the wacsindex paged icon display within the Wacs-PHP simple skin.

Taking the example of wacsindex, or rather it's configurable alter-ego, wacspage, this meant that we wanted the link on model's names to jump out to the Wacs-Php Simple Skin version of the modelpage (girlie.php) rather than using the conventional wacsmpthumbs. We also wanted to suppress the links on the Photographer name as we have no photographer handler in the Wacs-Php simple skin yet.

The Special handler Menu

Diving straight in, here is the handler menu from the simple.cfg file distributed with the Wacs-Php Simple Skin.

Example 19.2. Sample handler Menu

 <handlers>
  <models>#BASEURL#simple/girlie.php?modelno=#OPTIONS#<models>
  <photographer>#</photographer>
 </handlers>

The first of the active lines specifies that links on model names should link to the model page from the Wacs-Php simple skin, girlie.php. The second one merely suppresses the link to photographers, as the environment concerned does not include a displayer for that data type. If you want to test for a null return, check for the reply being just the hash symbol.