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: EfA Font Resizer¶
Author: | Kasper Skårhøj |
---|---|
Created: | 2002-11-01T00:32:00 |
Changed: | 2011-11-08T16:04:21 |
Classification: | efafontsize |
Keywords: | forAdmins, forBeginners |
Author: | François Suter |
Email: | typo3@cobweb.ch |
Info 4: | |
Language: | en |
EXT: EfA Font Resizer - efafontsize
EXT: EfA Font Resizer¶
Extension Key: efafontsize
Language: en
Keywords: forAdmins, forBeginners
Copyright 2000-2011, François Suter, <typo3@cobweb.ch>
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¶
`Introduction 3 <#__RefHeading__640_65439829>`_
Should you really use this extension? 3
`Users manual 4 <#__RefHeading__654_65439829>`_
`Configuration 5 <#__RefHeading__660_65439829>`_
`To Do List 7 <#__RefHeading__666_65439829>`_
`Known problems 8 <#__RefHeading__668_65439829>`_
Introduction¶
What does it do?¶
This extension allows to display on your web site controls for changing the font size using JavaScript. Font size can be enlarged, reduced or reset to some default value.
Screenshots¶
Here's a web page with the three font size controls (larger, default and smaller).
Credits¶
The JavaScript used in this extension was developed by the accessibility web site Einfach für Alle ( http://www.einfach-fuer- alle.de/ ). It was slightly modified to add the “reset” control. Permission to package this script into a TYPO3 extension was requested, but no answer was ever received. Since the script is free for download and devoid of any license or copyright notices, it is probably alright. I have added copyright notices in the JavaScript files, just so that the origin does not get forgotten.
Should you really use this extension?¶
This JavaScript has actually been removed from the Einfach für Alle web site by the authors themselves. There's a full explanation of the reasons, but it's only in German ( http://www.einfach-fuer- alle.de/blog/id/2457/ ). The gist of it is that the authors consider that such JavaScript is not really useful anymore. First of all it is useless for a whole bunch of people with disabilities (e.g. blind people don't care about the font size). These people generally have other means of reading or improving the readability of web sites. Furthermore most operating systems can now handle zooming natively, allowing to magnify the whole web page and not just the font of some areas.
Also according to the Einfach für Alle team web site owners tend to put this kind of widget in their web site and think that they have solved all accessibility problems, whereas making a web site accessible requires much more than this.
I'm not removing this extension from TER, because it is in use and some clients will still want to have such a widget in their web site, but you might want to try and argue that being serious about accessibility implies rather more efforts than just some font size changing JavaScript.
Questions?¶
If you have any questions about this extension, please ask them in the TYPO3 English mailing list (typo3.english), so that others can benefit from the answers.
Keeping the developer happy¶
If you like this extension, do not hesitate to rate it. Go the Extension Repository, search for this extension, click on its title to go to the details view, then click on the “Ratings” tab and vote (you need to be logged in). Every new vote keeps the developer ticking. So just do it!
Users manual¶
Installation¶
The installation is quite simple:
download and install the extension using the Extension Manager
include the extension's static TS template into your template
Using the resizer¶
The font resizer cannot be used as a content element. It is designed to be used purely as a TypoScript inclusion in your template. This is done as follows (if using TemplaVoilà):
lib.fontsize < plugin.tx_efafontsize_pi1
lib.fontsize {
defaultFontSize = 80
fontSizeIncrement = 10
}
and then using that lib.fontsize object in one of your elements. The syntax is similar with the markers system:
temp.fontsize < plugin.tx_efafontsize_pi1
temp.fontsize {
defaultFontSize = 80
fontSizeIncrement = 10
}
page.subparts.FONTSIZE < temp.fontsize
assuming you have a ###FONTSIZE### marker in your HTML model.
On top of that an initialization script must be called as the very first thing after the <body> tag. Let's assume that your PAGE object is called “page” and that the content first comes at index 10:
page = PAGE
page.10 = USER
page.10 {
...
}
then the font resizer initialization must be called with an index smaller than 10, e.g.:
page.1 < plugin.tx_efafontsize_pi1
page.1.userFunc = tx_efafontsize_pi1->initEfA
Note that the userFunc must be changed. It is not the traditional “main” that is called in this case, but another method called “initEfA”.
Configuration¶
TypoScript Constants¶
defaultFontSize¶
Property
defaultFontSize
Data type
int
Description
Default font size expressed as a percentage (but without units)
Default
100
fontSizeIncrement¶
Property
fontSizeIncrement
Data type
int
Description
Increment by which the size of the font should be varied (up or down) every time a control is pressed. Expressed as a percentage (but without units)
Default
10
TypoScript Setup¶
defaultFontSize¶
Property
defaultFontSize
Data type
int
Description
Default font size expressed as a percentage (but without units)
Default
{plugin.tx_efafontsize_pi1.defaultFontSize}
fontSizeIncrement¶
Property
fontSizeIncrement
Data type
int
Description
Increment by which the size of the font should be varied (up or down) every time a control is pressed. Expressed as a percentage (but without units)
Default
{plugin.tx_efafontsize_pi1.fontSizeIncrement}
controlOrder¶
Property
controlOrder
Data type
string
Description
This string defines the order of display of the controls. It contains the three words “smaller”, “reset” and “bigger” separated by commas. It must absolutely contain those three words, even if you intend to hide some controls. Hiding a control is achieved by using the boolean value of each control as described below. If even one word is missing from this property, the script will revert to the default value.
Default
smaller,reset,bigger
bigger¶
Property
bigger
Data type
boolean/ ->controlConfig
Description
Set to 1 to display the “Enlarge font size” control. Set to 0 to hide. Configuration parameters for the controls are entered as sub- properties.
Default
bigger = 1
bigger {
insideHTML = IMAGE
insideHTML.file = EXT:efafontsize/res/icons/bigger.gif
}
reset¶
Property
reset
Data type
boolean/ ->controlConfig
Description
Set to 1 to display the “Reset font size” control. Set to 0 to hide. Configuration parameters for the controls are entered as sub- properties.
Default
reset = 1
reset {
insideHTML = IMAGE
insideHTML.file = EXT:efafontsize/res/icons/reset.gif
}
smaller¶
Property
smaller
Data type
boolean/ ->controlConfig
Description
Set to 1 to display the “Reduce font size” control. Set to 0 to hide. Configuration parameters for the controls are entered as sub- properties.
Default
smaller = 1
smaller {
insideHTML = IMAGE
insideHTML.file = EXT:efafontsize/res/icons/smaller.gif
}
[tsref:plugin.tx_efafontsize_pi1]
Control parameters
beforeHTML¶
Property
beforeHTML
Data type
cObj
Description
HTML to be displayed before the control proper
Default
insideHTML¶
Property
insideHTML
Data type
cObj
Description
The control itself
Default
an IMAGE cObj with a relevant icon (see above)
class¶
Property
class
Data type
string
Description
Value of the class attribute to apply to the <a> tag around the control
Default
id¶
Property
id
Data type
string
Description
Value of the id attribute to apply to the <a> tag around the control
Default
name¶
Property
name
Data type
string
Description
Value of the name attribute to apply to the <a> tag around the control
Default
accesskey¶
Property
accesskey
Data type
string
Description
Access key for the control
Default
onmouseover¶
Property
onmouseover
Data type
string/stdWrap
Description
JavaScript to execute upon the onmouseover event. It seems using double quotes inside this property doesn't work, so stick to single quotes.
Default
onmouseout¶
Property
onmouseout
Data type
string/stdWrap
Description
JavaScript to execute upon the onmouseout event. It seems using double quotes inside this property doesn't work, so stick to single quotes.
Default
onfocus¶
Property
onfocus
Data type
string/stdWrap
Description
JavaScript to execute upon the onfocus event. It seems using double quotes inside this property doesn't work, so stick to single quotes.
Default
afterHTML¶
Property
afterHTML
Data type
cObj
Description
HTML to be displayed after the control proper
Default
[tsref:plugin.tx_efafontsize_pi1.controlConfig]
To Do List¶
Nothing planned. It is planned to make this extension obsolete soon.
Known problems¶
None to date. Please report any problem to the project's bug tracker: http://forge.typo3.org/projects/extension-efafontsize/issues.
8