Style Switcher

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

Style Switcher

Postby Stark Raving » Mon Mar 30, 2009 12:15 am

I can't seem to get any of the style switchers listed in google searches to work. Nor is it clear to me what the best option is: javascript, php or jquery? Any suggestions or ideas? Has someone already made such a thing? I haven't the knowledge to make such an extension. I would if I could. Would like it for testing various designs on the same site. I know I can use "alt" style sheets in the head, but I'd like the style change to be maintained throughout the site, if that makes sense. Otherwise, I have to keep selecting the alternate style. Thanks.
"After I'm dead I would rather have people ask why I have no monument than why I have one." ~ Cato the Elder

"In heaven all the interesting people are missing." ~ Friedrich Nietzsche
User avatar
Stark Raving
Silver Sponsor
 
Posts: 115
Joined: Tue Dec 11, 2007 9:24 pm
Location: Vancouver

Re: Style Switcher

Postby janozaurus » Mon Mar 30, 2009 8:12 pm

There basically two ways to switch a style. Either you let the server (PivotX) render the page again using a different template or you have to client (via javascript) use a different CSS.

The first option can be implemented by appending ?te=sometemplate to the URI, I believe. Haven't tried myself on PivotX. This should work with all PivotX styles.

The second option requires all style to uses the (X)HTML code with different style sheets. Then you can use Javascript/DOM to choose an alternate stylesheet. This will require a customized PivotX style and several style sheets.
janozaurus
 
Posts: 38
Joined: Mon Nov 26, 2007 9:03 am

Re: Style Switcher

Postby rabbeltje » Thu Jun 04, 2009 12:44 pm

can anyone tell me more about how to do this? i've tried some js-switchers but it doesn't seem to work...
User avatar
rabbeltje
 
Posts: 358
Joined: Mon Aug 25, 2008 11:54 am
Location: Neerbeek, The Netherlands

Re: Style Switcher

Postby Stark Raving » Thu Jun 04, 2009 7:57 pm

I wanted this so I could work on designs without interferring with or disrupting the main site design. You probably know this, rabbeltje, but just for others: in the template folder I created a new style folder where all the pages, images and css of the new template design resides. PivotX already has a few that will serve as an example.

Once a new weblog is set up that uses the page templates of the new design, to view the frontpage in an internet browseer, the URL would be http://sitename.com/?w=webblogtitle (or whatever is placed between the [[weblogtitle]] tag) and that can be bookmarked so one can view the changes made as one works on the new template. If the new blog is called "My New Template" then the URL would be http://sitename.com/?w=my-new-template.

I, also, have had no success with the style switchers out there in cyberspace. I tried the ?te=sometemplate, but that just went to the default weblog. So, if anyone has a script that can allow a person to switch styles, and has some way to "remember" what style the person chose, please enlighten us. Be very specific, because I'm not that expert at scripts. Where does the script go? What changes need to be made to the code? That sort of info. Don't care if it's javascript or php based. Maybe there are pros and cons to having one or the other in PivotX.

Much thanks in advance.
"After I'm dead I would rather have people ask why I have no monument than why I have one." ~ Cato the Elder

"In heaven all the interesting people are missing." ~ Friedrich Nietzsche
User avatar
Stark Raving
Silver Sponsor
 
Posts: 115
Joined: Tue Dec 11, 2007 9:24 pm
Location: Vancouver

Re: Style Switcher

Postby rabbeltje » Fri Jun 05, 2009 6:42 am

i've been doing the same with my styles. but in the meantime i've developed a whole bunch of them and thought it would be nice to be able to have people pick there own style, which is why i was wondering :)

i found a script the other day that loads a different css each time the page loads, but couldn't get that one to work either...
User avatar
rabbeltje
 
Posts: 358
Joined: Mon Aug 25, 2008 11:54 am
Location: Neerbeek, The Netherlands


Return to 2.x Extensions

Who is online

Users browsing this forum: No registered users and 1 guest