Page 1 of 1

Template chooser

Posted: Wed Nov 23, 2011 2:30 am
by Eni
Hi~

a small snippet format question again, sorry.

I installed "serendipity_event_templatechooser" and added this to my index.tpl:

Code: Select all

<a href="index.php?serendipity[template]=mimbo-eni">Green</a>
<a href="index.php?serendipity[template]=mimbo-eni-red">Red</a>
<a href="index.php?serendipity[template]=mimbo-eni-purple">Purple</a>
Apparently this is either not how it works or I use the wrong template names. As I understood from an older post, I just need to install the template chooser and add the link in the format "index.php?serendipity[template]=mimbo" but I must overlook something since it doesn't work :|

What I basically want to do is let the visitor choose the link (highlight) color of mimbo which is actually changing just five font color parameter in the style.css file. I tried adding a simple php css switch first but couldn't get it to work. I suppose because Smarty needs a different syntax and I didn't do it right. So I wanted to try it with the template chooser now, which is a bit overkill for just one color in the css file, but oh well. I don't want the dropdown but just a small line of colored mini-squares on top of my header to click on for the color switch. I tried looking at the dropdown source code of the blog but I have no idea how to rewrite that from a dropdown list to plain links :?

~eni

Re: Template chooser

Posted: Wed Nov 23, 2011 11:45 am
by garvinhicking
Hi!

You need to use serendipity[user_template]=XXX :)

Regards,
Garvin

Re: Template chooser

Posted: Wed Nov 23, 2011 12:44 pm
by Eni
Moin,

hmmmm, that didn't work.

However, this did:
<a href="index.php?user_template=mimbo-eni">Green</a>
<a href="index.php?user_template=mimbo-eni-red">Red</a>
<a href="index.php?user_template=mimbo-eni-purple">Purple</a>
Without the "serendipity[]". I take it as solved now, unless you think that this shouldn't be the correct way :D

Thank you~! ;*

//edit
You know, if I'm allowed to make a suggestion:
I think it would a good addition if there was a community wiki where each plugin and usage topic has a page and everyone can contribute code snippets, examples and tricky solutions to questions asked in the forum. The documentation for this template chooser, as example, is really only covering the "what it does" but without the background knowledge, it's already hard to just make such a simple thing like a linklist instead of a dropdown. I feel like a bother for asking so simple stuff, which is because I can only edit but not understand what I do, in most cases :|

The official s9y documentation covers the basic but concrete examples by users for users, like as in this case a more simple and pretty template switch, would be really nice, I think.

~eni

Re: Template chooser

Posted: Wed Nov 23, 2011 2:03 pm
by garvinhicking
Hi!

We have a wiki, and we also hand out access to anyone who would like to contribute! I can send you an account if you like!


Regards,
Garvin

Re: Template chooser

Posted: Tue Nov 29, 2011 2:24 pm
by Eni
Hi,

I'm sorry for late replies. I'm a bit in the middle of finishing my studies this semester. The current blog project is supposed to become my portfolio for work and applications :)

Hmm, I don't think I can contribute much since I can't code myself (due to a math and logic disorder), just adapting a bit. So I'd probably more leech than be a help, if this is fine with you, I'd love to have access ^^;

~eni

Re: Template chooser

Posted: Tue Nov 29, 2011 2:58 pm
by garvinhicking
Hi!

The wiki is already publically readable, so no need for any access then. You'd only need an account if you want to actually write/contribute anything into the wiki. :)

Regards,
Garvin

Re: Template chooser

Posted: Fri Dec 16, 2011 9:32 pm
by Eni
Hi,

sorry, busy as always ^^;
(And sick - gawd, I felt so bad...)

Aaah, so you mean the Docs on the frontpage. I was thinking of having really one page per plugin and/or task, and collecting solutions from the forum there.

As example, I use colored dots now to switch the template color with help of the template chooser event plugin. I would like to note that down in a easy to understand way for people looking for such a solution. So if there were a open s9y wiki, I could now put it on the page "template chooser plugin" as well as on... dunno... "user choice for templates" or so.

Would you like to extend the Docs with such categories? I wouldn't mind helping, if there's interest for it, else I just note it down on my website, I guess.

~eni

Re: Template chooser

Posted: Fri Dec 16, 2011 10:42 pm
by garvinhicking
Hi!
Aaah, so you mean the Docs on the frontpage. I was thinking of having really one page per plugin and/or task, and collecting solutions from the forum there.
The wiki is what people make out of it - this would surely be possible! :) Sure, I'd appreciate such content a lot.

If the book-open-sourcification goes along well we'd also have a starting base for that, so maybe it could be worth working from there. On the other hand, anything that gets contributed now can be implemented into that work later as well...

I'll PM you with a wiki account :)

Re: Template chooser

Posted: Sat Dec 17, 2011 4:07 am
by Eni
Thank you! I should have some time this weekend to take a look, unless I fall out of the window while decorating it :mrgreen:

~eni