CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Changing Theme On Fly

Print topic Send  topic

Author Message
p3ptools

Posts: 19
Posted: 07/08/2004, 3:26 PM

Hello,
is it possible to change a site wide theme on the fly,
say in response to a user preference?

Stephen
_________________
Sometimes the complaints will be false...
View profile  Send private message
peterr


Posts: 5971
Posted: 07/08/2004, 4:54 PM

Yes but this involves some changes that could damage your project if something goes wrong. General steps:
1. Backup your project.

2. Copy the Themes that you plan to use to your project folder (from C:\Program Files\CodeChargeStudio\Components\Themes)

3. Rename Theme names in all Style.css files from (ThemeName) to "Default", so that all Style.css files in Themes subfolders refer to "Default" theme.

4. Run Search & Replace on your HTML files to replace "Themes/(ThemeName)" with nothing. This is intended to remove all reference to specific themes. (ThemeName) would be the name of the main theme that you use in your pages.

5. Run Search & Replace on your HTML files to replace (ThemeName) with "Default".

6. Open each page and in the HTML mode place this HTML snippet below the <title> tag:
<base href="http://localhost/DynamicTheme/Themes/{Label1}/">
However, instead of typing {Label1} insert there the actual Label from the Toolbox.

7. Create the BeforeShow event for Label1 that will dynamically change its value to the name of the Theme that you want to select at run-time. For example in PHP: $Label1->SetValue("Aqua"); would apply the "Auqa" Theme to the page.

8. Publish the page to test it out. If something doesn't look right it's possible that the modified Style.css weren't published. You can then manually copy your Theme directory to the server, or change Project Settings to publish "All files with extensions" instead of "Project Files".

9. This is it.
Backup your project again, especially the Themes that you copied to your project folder and then modified (Style.css files).

It may be actually better to backup and modify the Style.css files directly in "C:\Program Files\CodeChargeStudio\Components\Themes" folder. I can expand on this once you get your dynamic Themes initially working the way I described.

Please keep this mind that this is an unsupported solution and our support may not be able to help you implement this if you cannot. It is offered only as a tip for experienced users.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
p3ptools

Posts: 19
Posted: 08/03/2004, 1:33 PM

Hello,
this dynamic method worked ok.

I now have a system where users can change to different style's.

Stephen
_________________
Sometimes the complaints will be false...
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.