Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine

1.3. Configuration (Constants)

Configuration (Constants)

Base: plugin.tx_scriptmerger

Constant

Description

Default

css.

CSS configuration options

  enable

Enable all css processes

1

  addContentInDocument

Embed the resulting css directly into the document in favor of an external link (this causes the compression processing to be disabled)

0

  minify.

CSS minify options

    enable

Enable the minification process

1

    ignore

A list of files which should be ignored from the minification process. Be careful, because you need to quote the characters yourself, because this are regular expressions. You can separate multiple ignore entries with a comma.

  compress.

CSS compress options

    enable

Enable the compression process

1

    ignore

A list of files which should be ignored from the compression process. Be careful, because you need to quote the characters yourself, because this are regular expressions. You can separate multiple ignore entries with a comma.

  merge.

CSS merge options

    enable

Enable the merging process

1

    ignore

A list of files which should be ignored from the merging process. Be careful, because you need to quote the characters yourself, because this are regular expressions. You can separate multiple ignore entries with a comma.

javascript.

Javascript configuration options

  enable

Enable all javascript processes (by default only for the head section)

1

  addContentInDocument

Embed the resulting css directly into the document in favor of an external link (this causes the compression processing to be disabled)

0

  parseBody

Enable this option to enable the minification, processing and merging processes for the body section too. They are always included directly before the closing body tag.

0

  addBeforeBody

Add the javascript files of the head section directly before the body tag. Be careful about this option, because it can cause much harm to your site!

0

  doNotRemoveInDocInBody

This option can be used to prevent embedded scripts inside the document of the body section to be merged. This is enabled by default to cause less harm as possible.

1

  minify.

Javascript minify options

    enable

Enable the minification process

1

    ignore

A list of files which should be ignored from the minification process. Be careful, because you need to quote the characters yourself, because this are regular expressions. You can separate multiple ignore entries with a comma.

  compress.

Javascript compress options

    enable

Enable the compression process

1

    ignore

A list of files which should be ignored from the compression process. Be careful, because you need to quote the characters yourself, because this are regular expressions. You can separate multiple ignore entries with a comma.

  merge.

Javascript merge options

    enable

Enable the merging process

1

    ignore

A list of files which should be ignored from the merging process. Be careful, because you need to quote the characters yourself, because this are regular expressions. You can separate multiple ignore entries with a comma.

Example:

The following configuration is used on one of my maintained production sites. On the page all javascript and css is merged, compressed and minified. Furthermore we are exclude any mootools (already minified)  and statistics scripts (due a bug) from being minified, because this would harm the final result. Also the deployJava script is ignored for merging, because it's added inside the body and the merging would cause an invalid loading order of the scripts. On the page type 101 we have disabled the scriptmerger, because the type contains a template which is used by a pdf generator extension (EXT:df_pdf; based upon html2ps). The parser engine of html2ps is very error-prone and can cause several problems with minified or compressed files. Also it wouldn't gain much performance to enable the merging, because this isn't the bottleneck here.

You see that it possible to get an advanced configuration with just some small changes to the options!

plugin.tx_scriptmerger {  javascript {    parseBody = 1        minify {      ignore = \?,mootools-,phpmyvisite    }        merge {      ignore = \?,deployJava    }  }}[globalVar = GP:type = 101]plugin.tx_scriptmerger {  css.enable = 0  javascript.enable = 0}[end]