Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 05:57:18 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Font size switcher problem  (Read 1760 times)
heth

Offline Offline

Posts: 54


« on: November 20, 2007, 05:52:43 PM »

Hi there

I've found a great script for adjusting font size. It's PHP and CSS, no Javascript which is exactly what I need.

http://articles.techrepublic.com.com/5100-3513_11-6002439.html

Iit works fine in a normal page but not when I put it in a WB template. I suspect its because it wants the stylesheets, pages and resize.php in the same folder but I've tried hardcoding paths, putting all the files in root and template folder and it just won't work.

Has anyone got any ideas? I've been staring at this all afternoon and probably need fresh ideas now
Logged
doc
Guest
« Reply #1 on: November 20, 2007, 06:04:06 PM »

Hello,

well just use relative font sizes like em or % in the CSS definitions of your template and let the user choose the font size he wants. In Firefox I can easily do this with STRG+, STRG- and STRG 0.

All modern browsers support that kind of switches.

Regards Christian
Logged
heth

Offline Offline

Posts: 54


« Reply #2 on: November 20, 2007, 06:13:09 PM »

I know, and agree. But this site is specifically aimed at the elderly and is intended to be as accessible as possible.

It would be a good plus for me to have this as the organisation is part of a larger group, and some of the other branches have it on their site

In the comments tagged to this script is the following:

"Many of my customers are seniors who are active computer users. I wish to redesign my web site to include impaired accomodations, visual and hearing alike.
I have not attempted the sample code, which mentions buttons. However, I did check out the Gravic and PrincipiaProducts sites. I must have misunderstood this article. I found no trace where adjustments can be made (buttons or instructions). One thing I do know is that if you are dealing with seniors, you had best make it as plain as day."

This followed a discussion about just using what's built into the browser. This user didn't know it was there. I agree people should be educated to use these features but in the meantime, I need to push the features in their face in another way.
« Last Edit: November 20, 2007, 06:31:43 PM by heth » Logged
marathoner

Offline Offline

Posts: 495


« Reply #3 on: November 20, 2007, 06:36:51 PM »

@heth

Just an idea...but you could simply create multiple templates that differ only in the CSS and then switch templates. Here's a thread on using session variables to make the template switch persistent. Seems to work fine.
http://forum.websitebaker.org/index.php/topic,7389.0.html
Logged
heth

Offline Offline

Posts: 54


« Reply #4 on: November 21, 2007, 03:08:24 PM »

that's not a bad idea. thanks for that. I'll give it a whirl
Logged
heth

Offline Offline

Posts: 54


« Reply #5 on: November 28, 2007, 05:01:45 PM »

it works a treat with one exception.

I'm using a slightly different template for the homepage. Need to get my head around how to have the slightly different homepage using the same template... but i'll get there!

thanks again for the suggestion
Logged
marathoner

Offline Offline

Posts: 495


« Reply #6 on: November 28, 2007, 05:37:13 PM »

@heth

Just a thought...you could modify your template to do X if page_id = your home page and Y if it's anything else. I use a similar technique to make the page appear to be two column if there is a section defined as block2 for a given page...otherwise it appears to be single column with a wider width.
Logged
heth

Offline Offline

Posts: 54


« Reply #7 on: November 28, 2007, 05:45:45 PM »

but because I'm using the theme switcher, the session remembers which template to use.

That's my problem.. I had a template that looked the same which included a news column. As soon as you click to use a different font size, the news will disappear

I have to use the same template but use sections instead for the news.

I think...

I've looked at this too long today. gonna come back to it tomorrow with fresh eyes.
Logged
marathoner

Offline Offline

Posts: 495


« Reply #8 on: November 28, 2007, 07:33:42 PM »

Without more info it's hard to understand exactly what you want to do.
Logged
heth

Offline Offline

Posts: 54


« Reply #9 on: November 28, 2007, 11:15:06 PM »

apologies. I've just reread your message and it makes more sense. Like I said, I'd been going nuts looking at it for hours.

Bed now and then revisit it again tomorrow, but I think your idea should work

Logged
heth

Offline Offline

Posts: 54


« Reply #10 on: December 04, 2007, 01:23:17 PM »

Just a thought...you could modify your template to do X if page_id = your home page and Y if it's anything else. I use a similar technique to make the page appear to be two column if there is a section defined as block2 for a given page...otherwise it appears to be single column with a wider width.

Apologies for not replying sooner... this is exactly what I want to do - have a news column on the front page but not on anything else. Do you have any code that you'd be willing to share? I'm not very good at php
Logged
heth

Offline Offline

Posts: 54


« Reply #11 on: December 04, 2007, 02:43:25 PM »

I think I've got it!!!!! Feeling very proud of myself for piecing together some php to do it! There was lots of trial and error but I did it! Wooo!

Just got to get the styling working, but it's looking good

Thanks you SOOOOOO MUCH for all the suggestions and for pointing me in the right direction.

You can have a look at what I've been going on about at http://www.ageconcernexeter.org.uk/index.php
« Last Edit: December 04, 2007, 03:01:30 PM by heth » Logged
seagull

Offline Offline

Posts: 81


« Reply #12 on: December 04, 2007, 05:17:36 PM »

Heather,

Ik works great!

Do you want to share the technic details with us?

How have you managed this?

Jan
Logged
heth

Offline Offline

Posts: 54


« Reply #13 on: December 04, 2007, 05:38:26 PM »

Some of its a bit clumsy.. but here goes:

I used the theme changer template http://forum.websitebaker.org/index.php/topic,7389.0.html and replaced the drop down box with text links. This also meant I could remove Javascript which is important for an accessible website.

Then I realised that my different template for the front page was no good because as soon as you changed font size, the news column would disappear.

Thanks to Marathoner's idea, I used PHP to check the filename. If the filename is equal to index.php, then it writes an extra piece of html into the template for a two column layout which includes the news column.

The clumsy thing is having the three templates which are the same except for which stylesheets they point at. I have got it down to just one stylesheet though. I could spend more time in making it neat but at the moment, I don't want to touch anything in case I break it wink

Does that all make sense?
Logged
seagull

Offline Offline

Posts: 81


« Reply #14 on: December 04, 2007, 05:58:02 PM »

Thanks,

I'll give it a try!

Jan
Logged
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!