CSS switcher on two sites?
Posted: 08 May 2005 05:55 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  244
Joined  05-16-2004

Hi,

I wanted to use the CSS switching plugin on two sites run off of the same EE installation. They do not use the same default stylesheet, though. Is there some way to make two (or more) arrays and specify which array to use on which site? Or do I need to try and hack a separate, differently-named, copy of the plugin file?

Profile
 
 
Posted: 08 May 2005 02:49 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Well, probably the simplest solution is to just duplicate the file and call it something like pi.css_switcher2.php and then change the class and function name in the new file.  By doing that you basically have a new plugin that you can call in the same way.

The alternative is to use the $global_vars array in path.php and use that to set the files=”” parameter for the plugin.  That parameter allows you to specify the CSS pages available for the plugin.

 Signature 
Profile
 
 
Posted: 10 May 2005 09:42 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  244
Joined  05-16-2004

Okay - thanks, Paul. Where do I change the class and function name? These lines?

line 29:

'pi_usage' => CSS_Switcher::usage()


line 33:

Class CSS_Switcher


line 53:

function CSS_Switcher()

Anywhere else?

Profile
 
 
Posted: 10 May 2005 09:44 AM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  244
Joined  05-16-2004

Oh - I forgot. Will I need to change the ee tags at all, or do I still use exp:css_switcher?

Profile
 
 
Posted: 10 May 2005 09:54 AM   [ Ignore ]   [ # 4 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Those are the three places to change the name, yes.  No, since you are changing the plugin name (and the filename) you will need to call it like {exp:css_switcher2}.

 Signature 
Profile
 
 
Posted: 10 May 2005 10:17 AM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  244
Joined  05-16-2004

So then the tag syntax would be {exp:newfilename}?

Profile
 
 
Posted: 10 May 2005 10:18 AM   [ Ignore ]   [ # 6 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Yes.

 Signature 
Profile
 
 
Posted: 10 May 2005 10:21 AM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  244
Joined  05-16-2004

Thanks, Paul.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64978 Total Logged-in Users: 21
Total Topics: 82016 Total Anonymous Users: 19
Total Replies: 440814 Total Guests: 187
Total Posts: 522830    
Members ( View Memberlist )