Aug 3 / dominicscaife

Resizing Font in Joomla

Joomla is an open source content management system that I’ve been getting to grips with lately. This article documents my quest to perfect my font resizer module.

{amazon id=”1590595718″ align=”left”}

As I delve deeper into the dark mysteries of fine tuning the Joomla interface to show exactly what I want it to I'm learning lots. But as usual with these things its quite slow and difficult going. Let me state the scenario. I want a font size module to ease accessibility on dominicscaife.com. Now I downloaded a decent module called FWResizeFont which does a reasonable job of doing 'what it says on the tin'.

As usual though the perfectionist in me wanted to tweak it a bit, first off I had to add some div tags to the increase and decrease size links, so I could make the increase a big 'A' and the decrease a little 'A'. Subsequent tweaking of my template css resulted in the look I was after. Finally,I tweaked the module suffix so it fits with the theme of my page and put it up in the top right menu group.

{amazon id=”1904811949″}

Now the next thing that I wanted to fix was some flashing that occurred as the page loaded. This happenedvbecause the default fontsize registered in the FontResizer module was different to the page in my own Dom Joomla Template. Quick fix to adjust the default fontsize in the modules settings did the trick…. but… there was one annoying problem remaining.

Basically, the fontresizer module was messing with my nice clear titles, and making them much smaller. I noticed in the module settings I could adjust what the fontresizer affected, and ensuring the resizer didn't affect h1, h2 and h3 tags fixed most of my titles… but… yet again a fix was needed for the main content frame titles which were still being shrunk. This lead on a long dark path of trying to determine where I needed to tweak the php to add some header tags to the titles that were still being shrunk.

My journey started with index.php, traversing frontend.php, joomla.php and various include file forks on the way to try and find the elusive tag that was causing me problems. I searched high and low, I investigated what patTemplate did, still not really sure how this is used, but eventually my search came to the end in the rather obvious conclusion of the com_content.php component …duh!

Well to cut a long story short, as this is already a pretty long story :P , I found the place and added the tags… and it didn't behave as I expected. The title was still shrunk by the javascript even though it had header tags… presumably because it was in a table. And the javascript was still shrinking tables fonts and not ignoring header tagged text in tables. Which left me with one option left… to play with the fontresizer settings again and this time tell it not to mess with table fonts…glory be, it worked… wish i'd done that 3 hours ago before my journey through code began.

…and that was that. Looks all purty now.

A few weeks later I discovered the javascript code used in this font resizer module was incompatible with some other javascript based modules I wanted to use, RSSDB2. So I’ve now tweaked the template adjuster module that came wih Joomla to switch between two Joomla templates that only differ in their fontsize. Seems to work quite well so far, fingers crossed on this one!

Leave a Comment