I'm talking about a front end style switcher so that visitors have the option to select different background colours and font sizes, each of which will point to a different stylesheet. Similar in function to this site http://www.remploy.co.uk/ where you can see the accessibility options at the top of the screen.
Just one more question. would I need to incorporate cookies so that the page used the same stylesheet when the visitor clicked onto a different page? and if so do you know how this would work?
Thanks Chriztian, you may have just saved my bacon!!
The code above works a treat, alas my lack of technical knowledge is letting me down once more.
I'm really stuck on getting the different pages to retain the chosen style. From reading through sites etc the best method seems to be using cookies, however I have NO EXPERIENCE whatsoever in using cookies at all.
Any advice Chriztian, or should I start a new thread?
Thanks for your continuing patience and knowledge in equal measure!! :-)
Probably good to keep the conversation in here - hopefully we end up with a "complete" solution :-)
I haven't used cookies that much from within XSLT - but anyway - your problem just got bigger, because now we need to think about lots more:
We can have no stylesheet specified at all, or we could have one stored in a cookie - we may also have one in the QueryString which should then override the cookie setting. And we have two modes to tackle this in...
CSS Style Swicther using XSLT
Hi Guys,
I'm setting up a series of websites for a diversity recruitment company and need to include styleswitchers to change both colour and font sizes.
Does anybody know of a XSLT / CSS combo that would accomplish this?
Cheers guys,
Bri
Hi Brian,
Are you talking about frontend styleswitchers or a switcher in the backoffice?
/Chriztian
Hi Chriztian,
I'm talking about a front end style switcher so that visitors have the option to select different background colours and font sizes, each of which will point to a different stylesheet. Similar in function to this site http://www.remploy.co.uk/ where you can see the accessibility options at the top of the screen.
Thanks
Brian
Okay,
I'd create a "StyleSheet" macro and put it in the <head> section on the Masterpage and do something like this in it:
/Chriztian
Superb, nice and clean! thank you.
Just one more question. would I need to incorporate cookies so that the page used the same stylesheet when the visitor clicked onto a different page? and if so do you know how this would work?
Thanks Chriztian, you may have just saved my bacon!!
Hi again,
Just thought I'd give you the other half too :-)
Add a "mode" parameter ("text") to the macro and replace the XSLT with this chunk:
Now in the <head> section, add mode="link" to the macro tag:
And wherever you want the styleswitcher to appear (another template, maybe?), use the mode "switcher":
Regarding the cookie thing... there are SetCookie() and RequestCookies() methods in umbraco.library you may be able to use for that...
Chriztian
YEY! Thanks Chriztian,
That actually all makes sense to me (I'm a real newby to Umbraco)
Really appreciate the help
Bri
Hi again,
The code above works a treat, alas my lack of technical knowledge is letting me down once more.
I'm really stuck on getting the different pages to retain the chosen style. From reading through sites etc the best method seems to be using cookies, however I have NO EXPERIENCE whatsoever in using cookies at all.
Any advice Chriztian, or should I start a new thread?
Thanks for your continuing patience and knowledge in equal measure!! :-)
Bri
Hi Brian,
Probably good to keep the conversation in here - hopefully we end up with a "complete" solution :-)
I haven't used cookies that much from within XSLT - but anyway - your problem just got bigger, because now we need to think about lots more:
We can have no stylesheet specified at all, or we could have one stored in a cookie - we may also have one in the QueryString which should then override the cookie setting. And we have two modes to tackle this in...
[ Insert famous Arnie quote here ]
/Chriztian
PS: "I'll be back"
Hi Chriztian
To quote random 70's character 'ace'
Cheers muchly
Bri
Okay - back again.
I have not tested this, so there may be things I didn't get - but at least you're able to test it - no changes to templates - just XSLT:
/Chriztian
Chriztian,
Thank you very much.... that works absolutely perfectly.
I would say that both of the solutions above are excellent pieces of code for different types of application throughout websites!
Thank you for a top and quick resolution.
Brian
is working on a reply...