Suntower
Posts: 225
|
| Posted: 09/22/2009, 2:38 PM |
|
Hi,
We have a web site with many different customers who log in. We would like to be able to select a different style sheet depending on their log in.
I thought we could create a Server variable and pass a parameter that selects the proper CSS as each page loads. Is this possible using ASP or JS? Examples?
TIA,
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 09/22/2009, 2:55 PM |
|
Yes
Set a session variable in the onclick event for login with the proper style sheet after login is sucessful.
Then in the before show event, set the proper style sheet in the html using template variables based on that session variable.
Since these events and functions are all CCS standards, you should be able to do it in all languages CCS supports.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
damian
Posts: 838
|
| Posted: 09/22/2009, 3:03 PM |
|
http://www.google.com/search?q=change+stylesheets
lots of examples....
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 09/22/2009, 3:14 PM |
|
Heck not being a JS or ASP Programmer I just took a look at the CCS documentation to try and find an answer for you...
Do a CCS Help search for set session variables
Everything you need will show up here.
The Styles help topic will even show you how to select the page styles dynamically using URLs or Cookies.
You will also find a topc on creating custom session variables at login.
Thse examples should help alot.
IF it were me I would use the example of the custom session variables but also change the redirect value on sucessful login to contain the style url parameter as shown in the examples.
Just a thought
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 09/22/2009, 3:35 PM |
|
In thinking about this maybe just setting your Style Session variable will all you will need to set.
Maybe experiment with that.
Also on logout. be sure to set it to null or a default value
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Suntower
Posts: 225
|
| Posted: 09/22/2009, 5:58 PM |
|
Thanks.
I don't get it. I'm using CCS 3 and the help under Style Sheets gives a step-by-step on how to enable Dynamic Style Sheets, but nothing happens. What -exactly- is supposed to happen when one enables this option and adds some style sheets as per the directions? Shouldn't some new markup appear in the HTML? Nothing does.
Any ideas?
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 09/22/2009, 6:25 PM |
|
According to the doc you select your URL param name, also the cookie name if using it, then call a page with that parameter.
I appears the parameter value must match a Stylesheet Name that exists and the site will use that style sheet.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
jjrjr1
Posts: 942
|
| Posted: 09/22/2009, 6:28 PM |
|
No I would expect no new markup in the HTML as CCS will put the new stye sheet into the template at run time
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
Suntower
Posts: 225
|
| Posted: 09/23/2009, 12:51 PM |
|
I'm using ASP and I created a sample project. I can't see -anywhere- either in the ASP or the HTML that shows any stylesheet selection code.
Can -anyone- give me a working example of how CCS does this? The nuts and bolts?
TIA,
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |