Page 1 of 1
Template Chooser Plugin - choosing which templates possible?
Posted: Tue Sep 29, 2009 9:25 pm
by user1234
Hi,
I'd like to implement the template chooser/styleswitcher plugin, but want the users to be able to only choose between two styles (one is black on white, the other is white on black). As I have to keep the default template, this one gets also shown in the dropdown menu. Is there a way to limit the templates shown to just two of my choosing?
Cheers,
Dachs
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Tue Sep 29, 2009 9:35 pm
by yellowled
user1234 wrote:I'd like to implement the template chooser/styleswitcher plugin, but want the users to be able to only choose between two styles (one is black on white, the other is white on black). As I have to keep the default template, this one gets also shown in the dropdown menu. Is there a way to limit the templates shown to just two of my choosing?
Hm. As far as I remember, there should be an internal URL which "executes" the template switch. You could hide the actual template chooser (after picking the 2 URLs you need) and "rebuild" it using a HTML nugget (or the template files) just linking to those 2 URLs.
I think there must be some thread about this somewhere in here, but maybe it was in the German only forum ...
YL
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Tue Sep 29, 2009 9:38 pm
by user1234
Hi YL,
yes I saw that, but unfortunately there was neither clearcut code nor an explanation of how this has to be done in that thread. So that leaves me none the wiser.
Cheers,
Dachs
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Tue Sep 29, 2009 10:10 pm
by Don Chambers
When you say you have to keep the default template, and it appears in the drop down list, which template are you referring to? And why do you HAVE to keep anything other than your black and white templates?
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Tue Sep 29, 2009 10:17 pm
by user1234
Hi Don,
I mean the default template called "default". If I delete it I get a smarty error when I try to access the admin interface. Restoring that template also ended that error.
Cheers,
Dachs
PS: it calls itself Serendipity v2.3
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Tue Sep 29, 2009 11:00 pm
by Don Chambers
Are you sure about that? Serendipity 2.3 is located in the folder /carl_contest/.... it was the template installed by default if no other template was selected beginning with s9y v1.0-1.2. The folder /default/ is where serendipity would look for smarty files if a template does not choose to provide custom versions.
The error you mentioned makes sense to me of the /default/ folder is deleted, not /carl_contest/.
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Wed Sep 30, 2009 7:05 am
by user1234
Hi Don,
the folder is named "default" on the server, it calls itself - in the theme choosing area of the admin interface and in the dropdown menu of the template-chooser - "serendipity v2.3". Possibly an XML-misnomer, no idea. Fact is I tried to delete all template folders except my two bulletproof adaptions I want to use and got a smarty error, was unable to access the admin area. I reinstalled the "default" folder and I again was able to administrate the blog.
So what is the solution to having people choose only between two different templates/styles?
The background is that my client wants a dark scheme (light typeface on black/nearblack surface) and I convinced her of at least providing people having eye problems with the choice of a scheme where there is dark/black typeface on a light surface.
I have nothing against doing this via links placed somewhere in the sidebar, there are only two choices, so that's not going to take much space or look clunky. I'd need a step-by-step rundown on how to do this though, including the full URI code for that.
In general and for the long run it would be great if the template-chooser plugin could get an admin-side choosing facility, where you can tick those templates you want to offer and have only those in the dropdown menu.
Cheers,
Dachs
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Wed Sep 30, 2009 9:17 am
by yellowled
Don Chambers wrote:Are you sure about that? Serendipity 2.3 is located in the folder /carl_contest/....
No, it is not. That's Serendipity v3.0 (by Carl, /templates/carl_contest/). Serendipity v2.3 (by Tom Sommer) is in /templates/default/.
"Carl Contest" used to be the
standard theme installed in new s9y installations, but it was
never the
default template, i.e. the fallback s9y fetches template files from. It couldn't have been, since it does not have all the necessary template files.
YL
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Wed Sep 30, 2009 10:55 am
by garvinhicking
Hi!
As YellowLED mentioned, install the templatechooser event plugin, install the templatechooser sidebar plugin, go to your blog, view the HTML sourcecode, copy the HTML portion that contains the dropdown for the templates, create a new html nugget insert the HTML portion you copied, remove all templates from the <option> list that you don't want, save the HTML nugget plugin, remove the sidebar templatechooser plugin.
'default' may never be deleted from the directory, but you can remove it from the HTML dropdown through this procedure.
Regards,
Garvin
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Wed Sep 30, 2009 4:42 pm
by Don Chambers
WHOOPS! Wrong version numbers on my part. Forgot all about Tom's being numbered as well...
Garvin & Yellowled's suggestion sounds perfect... you would end up with something LIKE (but not necessarily identical to) this:
Code: Select all
<form id="theme_chooser" action="/index.php?" method="post">
<select name="user_template" onchange="document.getElementById('theme_chooser').submit();">
<option value="Black" selected="selected">Black</option>
<option value="White">White</option>
</select>
</form>
The option values would be the exact template names you wanted to present to your visitors.
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Tue Oct 06, 2009 6:46 pm
by user1234
Hi,
for some reason this does not work.
I can't remove the sidebar template-chooser plugin, if I do, the event-template-chooser plugin gets removed at the same time.
I tried to hide the sidebar plugin and used the html nugget, but it only defaults to the template which is selected in the code. No switching possible.
Cheers,
Dachs
Re: Template Chooser Plugin - choosing which templates possible?
Posted: Tue Oct 06, 2009 7:03 pm
by user1234
Hi,
still no idea why your solution doesn't work, but I now found a different one!
If I rename the info.txt file in the template folders I don't want used into xinfo.txt, then they won't be shown in the dropdown list!
Cheers,
Dachs