.. You may want to use the usual include line. Uncomment and adjust the path. .. include:: ../Includes.txt ======================= EXT: CMD Source Include ======================= :Author: Christophe Monard :Created: 2010-09-15T17:52:26.190000000 :Changed by: Christophe Monard :Changed: 2011-03-04T15:56:23.810000000 :Classification: cmd_srcinc :Description: The keywords help with categorizing and tagging of the manuals. You can combine two or more keywords and add additional keywords yourself. Please use at least one keyword from both lists. If your manual is NOT in english, see next tab "language" ---- forEditors (use this for editors / german "Redakteure") forAdmins (use this for Administrators) forDevelopers (use this for Developers) forBeginners (manuals covering TYPO3 basics) forIntermediates (manuals going into more depth) forAdvanced (covering the most advanced TYPO3 topics) see more: http://wiki.typo3.org/doc_template#tags ---- :Keywords: CMD, Source Include, cache external source as internal, performance increase, YSlow score, GT Metrix score :Author: Christophe Monard :Email: contact@cmonard.fr :Language: en |img-1| |img-2| EXT: CMD Source Include - cmd\_srcinc .. _EXT-CMD-Source-Include: EXT: CMD Source Include ======================= Extension Key: cmd\_srcinc Language: en Keywords: CMD, Source Include, cache external source as internal, performance increase, YSlow score, GT Metrix score Copyright 2000-2008, Christophe Monard, This document is published under the Open Content License available from `http://www.opencontent.org/opl.shtml `_ The content of this document is related to TYPO3 \- a GNU/GPL CMS/Framework available from www.typo3.org .. _Table-of-Contents: Table of Contents ----------------- `EXT: CMD Source Include 1 <#__RefHeading__540_1964983386>`_ **`Introduction 3 <#__RefHeading__542_1964983386>`_** `What does it do? 3 <#__RefHeading__544_1964983386>`_ `Screenshots 3 <#__RefHeading__546_1964983386>`_ **`Users manual 4 <#__RefHeading__548_1964983386>`_** **`Configuration 5 <#__RefHeading__550_1964983386>`_** `Reference 5 <#__RefHeading__552_1964983386>`_ **`Known problems 6 <#__RefHeading__554_1964983386>`_** **`To-Do list 7 <#__RefHeading__556_1964983386>`_** **`ChangeLog 8 <#__RefHeading__558_1964983386>`_** .. _Introduction: Introduction ------------ .. _What-does-it-do: What does it do? ^^^^^^^^^^^^^^^^ - CMD Source Include is an alternative way to include CSS ans JS into your template. Every file you specify will be include as inline text so there is only one file for JS and one for CSS. Combined with other option such moveJsFromHeaderToFooter, removeDefaultJS = external, minifyJS and inlineStyle2TempFile. You'll be able to get a higher score with Yslow or GTMetrix and of course have a website faster to load. - CMD Source Include can cache external source too and use them internaly. So we didn't depend on multiple server response time. - You should install sourceopt to get cleaner html file. .. _Screenshots: Screenshots ^^^^^^^^^^^ As you can see, there is some optimisation we can do to improve speed |img-3| In order to get this I've configured my plateform like this : config.inlineStyle2TempFile = 1 config.removeDefaultJS = external config.minifyJS = 1 config.moveJsFromHeaderToFooter = 1 In the constants I've configured sourceopt like this : sourceopt { removeGenerator = 0 removeBlurScript = 0 removeEmptyLines = 1 removeNewLines = 1 formatHtml = 4 formatHtml.tabSize = -1 } .. _Users-manual: Users manual ------------ - Install the extension then define activelist of elements to include then, define there description. - There is a TS provided with the extension wich already include some data. You can use it to understand the way it will be used. - The extension must be include in page object : page.220282 = < plugin.tx\_cmdsrcinc - Here is an example configuration: plugin.tx\_cmdsrcinc { activeList = {$plugin.tx\_cmdsrcinc.activeList} src { ga { js = 1 js { url = http://www.google-analytics.com/ga.js cache = 1 cache\_lifetime = 86400 footer = 1 } } t3jquery { js = 1 js.subtype = t3jquery } sexyBookmark { js = 1 js.url = EXT:sexybookmarks/res/jquery/js/sexybookmarks.js css = 1 css.url = EXT:sexybookmarks/res/css/style.css css.order = 30 } websnapr { js = 1 js.url = http://bubble.websnapr.com/{$plugin.tx\_cmdsrcinc.websnapr}/ } globalStyle { css = 1 css.url = fileadmin/global.css css.order = 10 } } } page.220282 = < plugin.tx\_cmdsrcinc .. _Configuration: Configuration ------------- .. _Reference: Reference ^^^^^^^^^ There is the basic TS definition : .. ### BEGIN~OF~TABLE ### .. _activeList: activeList """""""""" .. container:: table-row Property activeList Data type String Description List of elements to include Default Constant : {$plugin.tx\_cmdsrcinc.activeList} .. _src-xx: src.xx """""" .. container:: table-row Property src.xx Data type none Description Array of elements definition Default .. ###### END~OF~TABLE ###### plugin.tx\_cmdsrcinc { activeList = ga, sexyBoormark src { ga { ... } sexyBoormark { … } } } And there the definition of element to include, for each we can define JS and CSS .. ### BEGIN~OF~TABLE ### .. _url: url """ .. container:: table-row Property url Data type String Description The url or file to read (not required if subtype = t3jquery) Default .. _cache: cache """"" .. container:: table-row Property cache Data type Bool Description Should the source be in TYPO3 cache? (If not defined, considered as true) Default 1 .. _cache-lifetime: cache\_lifetime """"""""""""""" .. container:: table-row Property cache\_lifetime Data type integer Description How low should the cache keeped, if set and external source not found (error when reading), the extension try to recover from older cache Default 604800 .. _order: order """"" .. container:: table-row Property order Data type integer Description Set it to order inclusion Default .. _footer: footer """""" .. container:: table-row Property footer Data type Bool Description JS should go to footer? Default 0 .. _subtype: subtype """"""" .. container:: table-row Property subtype Data type String Description Can actualy only be userfunc or t3jquery Default .. ###### END~OF~TABLE ###### plugin.tx\_cmdsrcinc.src { ga { js = 1 # 1 = included, 0 not included js.url = `http://www.google-analytics.com/ga.js `_ js.cache\_lifetime = 86400 js.footer = 1 # 1 = js goes to footer, 0 stay in header } myStyle { css = 1 css.url = fileadmin/my.css css.order = 10 } sexyBookmark { css = 1 css.url = EXT:sexybookmarks/res/css/style.css css.order = 40 css.cache\_lifetime = 604800 } } .. _Known-problems: Known problems -------------- None at this time .. _To-Do-list: To-Do list ---------- See “User manual” .. _ChangeLog: ChangeLog --------- - Add footer param for JS inclusion - Tested for TYPO3 4.5 - TYPO3 version dependancy change - Change default lifetime to 7 days - First release 8 .. ######CUTTER_MARK_IMAGES###### .. |img-1| image:: img-1.png .. :align: left .. |img-2| image:: img-2.png .. :border: 0 .. :height: 21 .. :hspace: 9 .. :id: Grafik2 .. :name: Grafik2 .. :width: 87 .. |img-3| image:: img-3.png .. :align: left .. :border: 0 .. :height: 246 .. :id: images1 .. :name: images1 .. :width: 662