View previous topic :: View next topic |
Author |
Message |
Alvin
Joined: 01 Jul 2002 Posts: 30
|
Posted: Tue Oct 15, 2002 7:44 am Post subject: Visitor selecting template? |
|
|
I've some diff HTML design, could I let my visitor choose which template to see?
It's diff html files, not CSS.
maybe like.. my index.php be
if cookie is 1 than
<? include 1st design>
elseif cookie is 2 than.... blah blah?
any help?  |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Wed Oct 16, 2002 4:41 am Post subject: |
|
|
I don't think so. Since the default template, index.php, is set in b2config.php, every other functions will "call" that template name. So unless you make some modifications to b2config.php file, I don't think that's possible.
I believe you could use if-else statements within the configuration file where index.php is set.
Michael P _________________ Michael P. |
|
Back to top |
|
 |
macshack
Joined: 17 Jul 2002 Posts: 1204 Location: Phoenix, Az
|
Posted: Wed Oct 16, 2002 5:19 am Post subject: |
|
|
Do a search for "theme". There have been a couple of threads discussing this subject.
michael e |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Wed Oct 16, 2002 5:24 am Post subject: |
|
|
But then, the "theme" solution would use CSS and the same index.php file. What he/she is asking is if it's possible to use different files for each theme, I believe.
Michael P _________________ Michael P. |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Wed Oct 16, 2002 6:02 am Post subject: |
|
|
I believe you could try the following . . .
Code: |
// in b2config.php
$blogfilename = 'index.php';
$theme = '';
// in your templates
// set by links by users
if ( $theme == 'blah' ) {
$blogfilename = 'index2.php';
}
else if ( $theme == 'blahblah' ) {
$blogfilename = 'index3.php';
}
|
And then in your templates, you would provide links that set the value $theme. _________________ Michael P. |
|
Back to top |
|
 |
Alvin
Joined: 01 Jul 2002 Posts: 30
|
Posted: Thu Oct 17, 2002 3:39 am Post subject: |
|
|
but how do visitor remember the settings? cookies? like those of the css changer? |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Thu Oct 17, 2002 3:49 am Post subject: |
|
|
Good question. I suppose you could use cookies. Can't help you there, though. I'm a beginner myself. However, in both ASP and ColdFusion, there are built-in cookies function. I'm sure someone else could help with that.
Michael P _________________ Michael P. |
|
Back to top |
|
 |
allusion
Joined: 16 Jun 2002 Posts: 73 Location: Houston
|
|
Back to top |
|
 |
Gadget Girl
Joined: 25 Jan 2002 Posts: 305 Location: Virginia
|
Posted: Thu Oct 17, 2002 5:32 pm Post subject: |
|
|
Hi,
I have posted on here about themes, where you have a cookie when a certain look to the blog is chosen. I'm putting skins on my blog at the moment using this method. You can see it without cookies here: www.simplysara.com/blog/
Is this what you were talking about?
Sara |
|
Back to top |
|
 |
Alvin
Joined: 01 Jul 2002 Posts: 30
|
Posted: Fri Oct 18, 2002 8:48 am Post subject: |
|
|
Gadget Girl wrote: | Hi,
I have posted on here about themes, where you have a cookie when a certain look to the blog is chosen. I'm putting skins on my blog at the moment using this method. You can see it without cookies here: www.simplysara.com/blog/
Is this what you were talking about?
Sara |
what is on ur site i believe is a css-styler? that switch the css only? i was thinking of switching the whole index.php  |
|
Back to top |
|
 |
GamerZ
Joined: 15 May 2002 Posts: 537 Location: Singapore
|
Posted: Fri Oct 18, 2002 3:41 pm Post subject: |
|
|
Alvin wrote: | Gadget Girl wrote: | Hi,
I have posted on here about themes, where you have a cookie when a certain look to the blog is chosen. I'm putting skins on my blog at the moment using this method. You can see it without cookies here: www.simplysara.com/blog/
Is this what you were talking about?
Sara |
what is on ur site i believe is a css-styler? that switch the css only? i was thinking of switching the whole index.php  | is possible, i changed my site colour without changing the css, but got some cookie problem _________________
++ GamerZ.Per.Sg - Complex Simplicity |
|
Back to top |
|
 |
Gadget Girl
Joined: 25 Jan 2002 Posts: 305 Location: Virginia
|
Posted: Fri Oct 18, 2002 6:11 pm Post subject: |
|
|
You just want to change where everything is right? That's just done with cookies and style sheets. I have been busy this week, but hope to have it finished next week totally skinned. Is this what you mean? http://www.domesticat.net/skins/howto.php
Sara |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Fri Oct 18, 2002 6:20 pm Post subject: |
|
|
I believe Alvin is asking a way to change "index.php" to something different so that he can use several files for different themes. In this case, the entire structure or layout would be changed. CSS has its limitation, and you are restricted to changing only placements, colors, fonts, etc., but by using different files, one can use entirely different layout as well as contents.
Michael P _________________ Michael P. |
|
Back to top |
|
 |
Gadget Girl
Joined: 25 Jan 2002 Posts: 305 Location: Virginia
|
Posted: Fri Oct 18, 2002 7:43 pm Post subject: |
|
|
Hm, I don't know about that Michael, I guess I'm reading his post differently. I have different includes for different themes. Maybe he could clarify what he's looking for, that would be nice! |
|
Back to top |
|
 |
Cyberian75
Joined: 26 Sep 2002 Posts: 1019 Location: Oregon
|
Posted: Fri Oct 18, 2002 7:54 pm Post subject: |
|
|
Oh, you are using different includes for each of your theme. Then, you must be using if-else statements, right? E.g., if theme is equal to 1, include blah.php, else include blahblah.php.
Michael P _________________ Michael P. |
|
Back to top |
|
 |
|