DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

EXT: abcsstidy

Author:Kasper Skårhøj
Created:2002-11-01T00:32:00
Changed:2007-04-21T12:40:15
Author:Andreas Balzer
Email:typo3@andreas-balzer.de
Info 3:based on TS Tidy
Info 4:by Mads Brunn

EXT: abcsstidy

Extension Key: abcsstidy

Copyright 2007, Andreas Balzer, <typo3@andreas-balzer.de>

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.com

Table of Contents

EXT: abcsstidy 1

Introduction 1

What does it do? 1

Configuration 2

Reference 2

Known problems 2

To-Do list 2

Credits 3

Changelog 3

Introduction

What does it do?

This extension helps you to deliver optimized CSS-code to the client's browser of your customers. It therefore integrated the C program CSSTidy which cleans your CSS-code, reorganizes it and returns optimal results. As an example: With the help of abcsstidy and CSSTidy, your manually TYPOSCRIPT generated CSS-code can become smaller by 30 percent. Until today this was not possible with TYPO3. But abcsstidy offers you the possibility to do all of the magic with a maximum of 3 lines TSCode per template. Yes, that means that abcsstidy enables you to chose an optimization for every single template itself. You can e.g. enable abcsstidy for a special page tree or you can change it's behaviour by changing the tidy – parameters in an extension template (+ext).

Please notice: If anything goes wrong during the optimization and CSSTidy does not return a CSS-code, the original CSS-code will be used, so that abcsstidy does not destroy your website.

Configuration

Go to http://csstidy.sourceforge.net/ and download the C version of CSSTidy to your server. You don't have to install it, it works right away. Just memorize the path where you chose to download CSSTidy to.

Install the extension in Extension Manager.

Configure the path input field to the path you saved CSSTidy into.

Modify your TypoScript Templates.Insert the following lines in your setup:

#enables abcsstidy
config.tx_abcsstidy.run = cache

#The parameters of CSSTidy
config.tx_abcsstidy.parameter = --preserve_css=true --compress_colors=true --sort_properties=true

Reference

config.tx_abcsstidy.run

Property

config.tx_abcsstidy.run

Data type

string

Description

Enables abcsstidy. Chose between 'all', 'cache' and 'output' (without quotationmarks)

'cache' – the template is sent through CSSTidy before it is stored in the cache

'output' – the template is sent through CSSTidy before it is sent to the client

'all' – both of the above

Default

'cache'

config.tx_abcsstidy.parameter

Property

config.tx_abcsstidy.parameter

Data type

string

Default

--preserve_css=true --remove_last_;=true --compress_colors=true --compress_font-weight=true --sort_properties=true

Known problems

- There are currently no problems known. Email me, if you have found one. typo3@andreas-balzer.de

To-Do list

None so far. Suggestions are welcome.

Credits

  • Thanks to Mads Brunn for providing the T3 extension TS Tidy with all the code and the documentation. I as a T3 extension newbie wouldn't have been able to code abcsstidy. I guess most of the code in my extension is just copied from his...
  • Also a great “Thank you” to the guys of the official T3 chat! I probably would still be looking for a good documentation, some code snippets and the answer, where my bugs are located.. This means especially pulponair and just2b. Pulponair told me about major security problems and told me, how to fix them. He also had the idea of using streams instead of files. (see changelog). Just2b helped me in using the modified EM values.
  • Then I would like to thank the CSSTidy coders and their mailinglist. Without them I wouldn't have had anything to code for.
  • Last but not least I would like to thank Kasper and the whole T3 CORE team for building the best online application I have ever seen! :) TYPO3 – Inspiring people to share!

Changelog

1.1.0 Rewritten the way, a request is sent to CSSTidy and how it's fetched again. The path setting has been moved to EM.

1.0.2 Added a security check that wraps the parameters with quotation marks to prevent system intrusion

1.0.1 Added a security check that checks the path for invalid requests

1.0.0 First stable version. All known bugs solved. Included documentation.

img-1 EXT: abcsstidy - 3