StepByStepRenderingOrder

Order of plugin handler calls

Here's an annotated example of the plugin handler calls during the view of a simple page (no skin, page contains a simple table). Note that this only shows handlers called in plugins that are actually registered. There are several other handlers that are not shown because no installed plugin ever calls them.
  • PREPARE PAGE HEADER
  • beforeCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::UI::View::_prepare
  • commonTagsHandler called from Foswiki::handleCommonTags Foswiki::UI::View::_prepare
    • EXAMPLE OF A PLUGIN ADDING AN HTTP HEADER
    • beforeCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::addToHEAD Foswiki::Func::addToHEAD Foswiki::Plugins::EditRowPlugin::commonTagsHandler Foswiki::Plugin::invoke Foswiki::Plugins::commonTagsHandler Foswiki::handleCommonTags Foswiki::UI::View::_prepare
    • commonTagsHandler called from Foswiki::handleCommonTags Foswiki::addToHEAD Foswiki::Func::addToHEAD Foswiki::Plugins::EditRowPlugin::commonTagsHandler Foswiki::Plugin::invoke Foswiki::handleCommonTags Foswiki::UI::View::_prepare
    • afterCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::addToHEAD Foswiki::Func::addToHEAD Foswiki::Plugins::EditRowPlugin::commonTagsHandler Foswiki::Plugin::invoke Foswiki::Plugins::commonTagsHandler Foswiki::handleCommonTags Foswiki::UI::View::_prepare
  • afterCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::UI::View::_prepare
  • startRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • preRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • renderWikiWordHandler called from Foswiki::Render::internalLink Foswiki::Render::_handleSquareBracketedLink Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare for each wikiword in the topic
  • endRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • postRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • PREPARE PAGE BODY
  • beforeCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::UI::View::_prepare
    • EXAMPLE OF A TAG (%SEARCH%) RECURSIVELY EXPANDING SEARCH RESULTS
    • beforeCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::Search::searchWeb Foswiki::SEARCH Foswiki::_expandTagOnTopicRendering Foswiki::_processTags Foswiki::expandAllTags Foswiki::handleCommonTags Foswiki::UI::View::_prepare
    • commonTagsHandler called from Foswiki::handleCommonTags Foswiki::Search::searchWeb Foswiki::SEARCH Foswiki::_expandTagOnTopicRendering Foswiki::_processTags Foswiki::expandAllTags Foswiki::handleCommonTags Foswiki::UI::View::_prepare
    • afterCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::Search::searchWeb Foswiki::SEARCH Foswiki::_expandTagOnTopicRendering Foswiki::_processTags Foswiki::expandAllTags Foswiki::handleCommonTags Foswiki::UI::View::_prepare
    • beforeCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::Search::searchWeb Foswiki::SEARCH Foswiki::_expandTagOnTopicRendering Foswiki::_processTags Foswiki::expandAllTags Foswiki::handleCommonTags Foswiki::UI::View::_prepare
    • commonTagsHandler called from Foswiki::handleCommonTags Foswiki::Search::searchWeb Foswiki::SEARCH Foswiki::_expandTagOnTopicRendering Foswiki::_processTags Foswiki::expandAllTags Foswiki::handleCommonTags Foswiki::UI::View::_prepare
    • afterCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::Search::searchWeb Foswiki::SEARCH Foswiki::_expandTagOnTopicRendering Foswiki::_processTags Foswiki::expandAllTags Foswiki::handleCommonTags Foswiki::UI::View::_prepare
  • commonTagsHandler called from Foswiki::handleCommonTags Foswiki::UI::View::_prepare
  • afterCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::UI::View::_prepare
  • startRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • preRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • renderWikiWordHandler called from Foswiki::Render::internalLink Foswiki::Render::_handleWikiWord Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • endRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • postRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • PAGE FOOTER
  • beforeCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::UI::View::_prepare
  • commonTagsHandler called from Foswiki::handleCommonTags Foswiki::UI::View::_prepare
  • afterCommonTagsHandler called from Foswiki::handleCommonTags Foswiki::UI::View::_prepare
  • startRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • preRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • endRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • postRenderingHandler called from Foswiki::Render::getRenderedVersion Foswiki::UI::View::_prepare
  • PREPARE HTTP HEADERS
  • writeHeaderHandler called from Foswiki::generateHTTPHeaders Foswiki::writeCompletePage
  • modifyHeaderHandler called from Foswiki::generateHTTPHeaders Foswiki::writeCompletePage
  • WRITE COMPLETED PAGE
  • completePageHandler called from Foswiki::writeCompletePage

The trouble with this sort of linear flow is that it's a work of fiction. Here's why:
  • Foswiki is a data-driven tool. The code flow changes depending on the content of the topic being rendered
  • The flow is different depending on the entry point (edit, view, preview, etc)
  • The flow is quite complex. Much more complex than the summary above.
  • Summaries are misleading, and cannot substitute for reading the code.
So bear these points in mind when trying to work out why your handler isn't being called!

See the technical overview of the Foswiki code to help put this in context.
Topic revision: r2 - 24 Nov 2008, CrawfordCurrie - This page was cached on 27 Jul 2016 - 03:25.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License