How can I add an easy way for visitors/users to change font sizes?
Fontsizer allows instant incremental text sizing, and preferred text size is remembered via a cookie setting. It adds button links to increase/decrease the size of all text via markup
(:fontsizer:), usually added to the SideBar or the header or top menu.
- Skin with fonts set to relative units (em or ex or %, not pt or mm etc.)
(:fontsizer:) for quick changing of all fontsizes. The preferred size gets stored in a cookie, so changes have an effect on viewing all the pages of the site and are remembered the next time the visitor/user comes back to the site.
Internationalisation of the fontsizer link names is enabled.
Depending on the font setting of the page section
(:fontsizer:) markup is deployed, the text font size may change initially. This can be counteracted by setting a different value for
$FontSizeDefault. For instance if the sidebar font is 75% of the body font size , then
$FontSizeDefault = '75'; may work better.
This problem of adjustments needed for various skins is caused by the placement of the script initialization code in a div and not immediately after the <body> tag in the html source. To overcome this place the variable
$FontSizerInit into the skin template file directly underneath the <body> tag. This will add the script initialization code into the more suitable placement.
If you wish to load the script via the skin's skin.php file, and have fontsizer.php and fontsizer.js moved to the skin directory, then you need to change the code line loading fontsizer.js to give the right location of
$SkinDirUrl and not
$FarmPubDirUrl, and add to skin.php
- 2006-10-28: Added $RecipeInfo
- 2006-09-02: Added access keys.
- 2006-04-28: Removed onkeypress event from fontsizer.js, which interfered with tab navigation.
- 2006-03-10: added switch and variable to enable better initialization.
- 2006-03-08: updated code so fontsizer will work in a Farm Isidor
- 2006-03-06: rewritten code so fontsizer can be added as cookbook module.
- 2005-11-19: first release as skin add-on module.
2007-05-19 Isidor Issue with
analyze It's not possible for the Analyze to find the version of script on pmwiki.org because of the zip file. could it be possible to have the .php and .css not in a Zip
Also the name in the Analyze is Cookbook:Fontsizer? and not Cookbook:FontSizer
There is a 2014-02-20 version of this receipe that downloads with the Triad skin.