Quick search:


How to improve context scouting

First read What is Context Scouting.

To do context scouting a footprint with data from the request of each page is stored under an unique id. Context scouting uses two parameters in the url or form to keep track of the context:

  • pntRef refers to the id of the footprint of the previous page, i.e. the one that contains the url or form
  • pntScd communicates the scouting direction. It can be d (down), u (up) and h (horizontal).
Technically the most reliable way to do context scouting is to allways include both parameters. However, to make transition from older versions easier, the pntScd parameter is often left out. To compensate each page class has a doScouting method that guesses the direction from the pntHandler parameter in the previous request. In specific applications you may have to override these methods or add pntScd parameters to urls and forms.

To debug the data that is collected by the scout, uncomment the lines at the bottom of PntSessionBasedScout::moved, the data will then be printed as comments at the top of each page.

Since phpPeanuts 1.2 alpha 1 the default layout and the generated urls do all contain the pntRef parameter. To support older layouts and urls, http_referer is used to find the previous footprint if the request does not contain the pntRef parameter. However, some browsers block the http_referer, and IE omits it if document.location.href is set from javascript. So to get older layouts and applications to work correctly with context scouting, we recommend to:
 - add <script> var pntFootprintId = 85; </script> to all your skinHeader.php files
 - add &pntRef='. $this->getFootprintId() to buttons, especially those that use
   javascript document.location=
  . check implementors of getPageButtonScript
  . check implementors of getMultiValuePropertyButtonScript
  . check implementors of addMultiValuePropertyButtons
  . check implemetors of getButtonsList
 - add pntRef hidden field to forms
 - check itemtables cell onclick to use javascript tdl function or to add &pntRef='. $this->getFootprintId()
 - check overriding implementations of javascript functions tdl and tdlGetHref
 - check implementations of ObjectSaveAction::finishSuccess to include pntRef into the new request
 - check context in selectionReport (first selection report is new context. This is
   taken care of by PntObjectSelectionReport::doScouting. If you use other pages that
   require a specific pntHandler request parameter value, you may want to override
   isSameContextHandler to make these pages share their context)
 - add &pntScd=d to menu's and all other places where you want to go into subcontexts (drill down)
 - check Context buttons, SaveAction, DeleteAction etc where you want to
  go back to context (move up)