jFinalizer developer notesfor joomla! component developers
IntroductionUsing jFinalizer while developing components, modules or plugins can be quite helpful to see what HTML output could look like after working through jFinalizer. Also, you can verify CSS / JS processing for your clients. This document gives a brief overview on how to implement jFinalizer during your application design workflow. Working with HTML compressionIts a great idea to verify that your component works properly with jFinalizer HTML output compression. Currently, we encourage developers to get Components working with at least Safe Mode C compression level. What usually influences correct rendering after jFinalizer HTML processing are HTML linebreaks and whitespaces. For example, processing Safe Mode C will reduce all necessary HTML whitespaces, although some browsers might eventually render them if present. So make sure to properly output whitespaces if they are between line breaks or opening / closing tags. For example this 2-line-statement would cause most browsers to render but after line break removal it would show as So if you require correct whitespaces between line breaks, its always a good idea to append or put both statements on one line with a whitespace. jFinalizer API toolsjFinalizer exposes itself into the joomla! mainframe when running, so you can check if jFinalizer is installed, running and processes HTML. If you cannot get your output render properly, there are tool functions to wrap a bypass around HTML or JavaScript blocks. But please note that this should be the last choice after trying to optimize your content. First of all, jFinalizer linkes an instance to itself to the joomla mainframe, so you can check if its installed / running: These public methods are available starting from jFinalizer 1.0.11: jFinalizer->doHTML() jFinalizer->startProtect(); jFinalizer->endProtect(); example: jFinalizer->protect(string $Inputdata); For example, you can check if jFinalizer is installed / running and write a wrapper function like this to make sure everything it output without processing, no matter if jFinalizer is installed, runs or not: tech notesjoomla system eventsjFinalizer hooks into the joomla system trigger onAfterRender and onAfterInitialize. All actual processing is done in onAfterRender. what jFinalizer knows about contentAbsolutely nothing. jFinalizer has no idea whats going on at the page. It simply processes HTML. However, jFinalizer checks if the system.cache plugin is running, so HTML processed content can be stored into cache. Unfortunately, there is no joomla! hook for caching, so jFinalizer hooks into system::onAfterInitialize, checks if system.cache is active and forces a re-trigger of system.cache's onAfterRender function after jFinalizer has compressed the content. Road Map
Comments & Bug ReportsWhen posting a bug report or problem, don't forget to post the jFinalizer version. If you use HTML compression, tell us what Mode you use. |
