Hello,
a user of my site should be able to change the font size through clicking a link/button. I found a description to achieve this in the forum but because I am a novice, in phpcms, php .. and css, I failed to get it work.
I refer to these postings of ssyfrig and brans in the forum (in German language) about changing the style of a site:
http://www.phpwcms.de/forum/viewtopic.p ... t=vorlagen
This was how ssyfrig succeeded:
---
Step 1
Download of file styleswitcher.js from http://www.alistapart.com/articles/alternate/
Step 2
Adjust file „index.php“, line 77-82
echo "<html>\n<head>\n<title>".$content["pagetitle"]."</title>\n";
echo '<meta http-equiv="Content-Type" content="text/html; charset=';
echo PHPWCMS_CHARSET."\">\n<script src=\"";
echo $phpwcms["templates"].'inc_js/frontend.js" type="text/javascript"></script>'."\n";
echo '<link rel="stylesheet" type="text/css" href="'.$phpwcms["templates"]."inc_css/".$block["css"]."\">\n";
echo $block["htmlhead"]."</head>\n\n<body".$content["body"].">\n";
Step 3
In the backend at admin > templates > html head add
<link rel="alternate stylesheet" type="text/css" href="../cssswitch/frontend2.css" title="wacky"/>
<script src="cssswitch/styleswitcher.js" type="text/javascript"></script>
Step 4
In article or template add
<a href="#"
onclick="setActiveStyleSheet('default');
return false;">change style to default</a>
<a href="#"
onclick="setActiveStyleSheet('paul');
return false;">change style to paul</a>
---
I (aks) created a folder “cssswitch”, path: phpwcms/cssswitch, with the files “styleswitcher.jos” and “frontend2.css” in it.
The link “change style”.. appears but nothing happens when I click it. Any ideas why not? Maybe wrong location of folder?
Thanks
changing font size through user
->frold wrote:may we see a demo?
http://www.garves.de/phpwcms1/index.php
(that´s a site just for learning phpwcms)
aks
Hi
Here can u see a demo http://phpwcms.syfrig.net/
On the main page you can switch between default and wacky.
Sven
Here can u see a demo http://phpwcms.syfrig.net/
On the main page you can switch between default and wacky.
Sven
Hi
I am not sure, but ..
this is your Link
and this these your css informations
you should change paul to wacky in your link.
hope this help
Sven
I am not sure, but ..
this is your Link
Code: Select all
<a href="#" onclick="setActiveStyleSheet('paul'); return false;">change style to paul</a>
Code: Select all
<link rel="alternate stylesheet" type="text/css" href="../cssswitch/frontend2.css" title="wacky"/>
hope this help
Sven
Ok, now it works!ssyfrig wrote: you should change paul to wacky in your link.
First I changed paul to wacky. Thanks for that tip, ssyfrig!
Then, after some trial and error, I deleted "../" in step 3:
Before
<link rel="alternate stylesheet" type="text/css" href="../cssswitch/frontend2.css" title="wacky"/>
<script src="cssswitch/styleswitcher.js" type="text/javascript"></script>
After
<link rel="alternate stylesheet" type="text/css" href="cssswitch/frontend2.css" title="wacky"/>
<script src="cssswitch/styleswitcher.js" type="text/javascript"></script>
Cheers!
aks