Selectable Templates
Posted: 07 January 2005 09:45 AM   [ Ignore ]  
Summer Student
Total Posts:  11
Joined  07-23-2003

i made certain to do some searches first, however came up empty-handed, so here goes.

is it possible to have user-selectable templates in EE… kinda like skins in a forum?

thank you

Profile
 
 
Posted: 07 January 2005 11:43 AM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  11
Joined  07-23-2003

i guess you would just need to manually create links in the navigation menu that point to the specific template group.

Profile
 
 
Posted: 07 January 2005 11:45 AM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  2541
Joined  12-21-2001

The short answer is that EE does not currently support “one-click theming”.  I’ll take the time to answer why this is the case since this question comes up once in a while, and has even been the source of some heated discussions. 

In order to permit your site’s design to change with the click of one button (I’m not talking about a simple CSS change.  That is possible to do and you’ll find lots of tutorials on the net) means that templates have follow rigid structural rules, and they have to contain a lot of scripting.  “One click”, while very simple from the user perspective, is quite complex from the program’s perspective.

The general rule is this:  The easier it is for a user to switch themes, the harder it is to customize the look of a given theme.  The converse is true as well.

There are a number of publishing systems on the market that allow theme switching (Radio, Nuke, Mambo, etc.).  In accordance with the above rule, however, you’ll find that sites that are managed using those programs tend to all look like one of their pre-packaged themes.  Rarely will you ever see a site that deviates significantly from a default theme due to the sheer complexity in making changes.  It involves wading into the scripting so it’s not for the timid.

We take the opposite philosophy.  We want to grant our users the ability to create sites that meet their unique vision.  In doing so we’ve made our templates as accessible and transparent as possible.  Granted, there are some specific tags that EE requires within its templates, but all things considered, customizing the look of an EE site is far, far easier than it is to customize the look of systems that support one-click themes.

Consider the incredible diversity of these EE powered sites, for example:

In These Times
Great Lakes College
OUKosher
SpiritHit News
Sageera

These sites would be very difficult to accomplish if we imposed the kinds of rigid rules necessary to allow one-click theming.

I understand that some people simply want to choose a pre-packaged theme and be done with it.  As much as I hate to say it, EE may not be the right program for them.  EE is a canvas for those who want to create something unique.  As such, it takes some effort to create an EE powered site, but the results are worth it, IMHO.

Having said all that, I’m open to the idea of creating a theme module in the future, that would allow users to choose which approach they want.  For those who want the power to create their own site, they can have it, and for those who want simple switching, they can have it too.  Part of me, however, resists this idea because I tend to be adverse personally to cookie-cutter sites.

I think that you are asking more about having your users select a theme when they are viewing your site, but what I wrote still applies.

 Signature 
Profile
MSG
 
 
Posted: 07 January 2005 12:06 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  11
Joined  07-23-2003

it certainly does and i appreciate the long answer.
i actually quite like making my sites unique and don’t mind the work that goes into it. 

i’ve used pmachine as well as mambo (which you mentioned), and have been trying to get a good hold of EE now that i just got it setup.  i want to see whether or not template changes are possible before i start really getting to work on all of the templates which i would like to offer on the site.  after a little research, i thought it would be possible to just add links to different styles… wouldn’t that work?

so if you had links which lead to
www.site.com/index.php/style1/index/
www.site.com/index.php/style2/index/
www.site.com/index.php/style3/index/

wouldn’t that work?
or would the links within all of the pages still point to style 1 which is the main one?

Profile
 
 
Posted: 07 January 2005 05:20 PM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
RankRankRankRankRank
Total Posts:  2541
Joined  12-21-2001

Your example would work fine.  Each “style” would be a different template group with it’s own templates.  You’d have ultimate control this way, since each template could be radically different from the next.  The only trick is that you’ll need a way to save each user’s theme choice using a cookie, then direct them to the proper theme based on the cookie’s contents.  There are plenty of PHP coders lurking around here that can probably help you with a code example if you’re not sure how to do this.  Or you can adapt some CSS switcher code for this purpose.

 Signature 
Profile
MSG
 
 
Posted: 05 September 2006 05:47 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  140
Joined  07-31-2005

If you are not caching your site here is a method that is not to complicated:

Create a Custom drop down selection in Members And Groups (for example, I’ll call it “skinny”.)

Example:
red
green
brown
blue

create a template group for your css files with same names:
Example:
Template Group;
style

Templates in Group;
red
green
brown
blue

Now use your logged_in / logged_out variables as such:

{if logged_in}
<link rel='stylesheet' type='text/css' media='all' href='{stylesheet=style/{exp:member:custom_profile_data}{skinny}{/exp:member:custom_profile_data}}' />
<
style type='text/css' media='screen'>@import "{stylesheet=style/{exp:member:custom_profile_data}{skinny}{/exp:member:custom_profile_data}}";</style>
{/if}

{if logged_out}
<link rel='stylesheet' type='text/css' media='all' href='{stylesheet=style/red}' />
<
style type='text/css' media='screen'>@import "{stylesheet=style/red}";</style>
{/if}

Notice I hard code the template group instead of using “My_Template_Group”. You could use this method but you would have to keep all of your CSS docs with in the default group established.

Now all you have to do is customize your “style sheets” and direct any image loads to the there appropriate image folders (ie. ../images/red/ or images ../images/green/, etc.)

=======
You could also get a little more advanced and create bookmarks for the login pages you create that correspond to styles used.

 Signature 

burningtroll

Profile
 
 
Posted: 13 November 2008 01:23 PM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  2
Joined  11-12-2008

I agree that this is a good approach, I prefer it for the way I work. I would rather spend a little more time on getting the theme set up if it gives me more flexibility and easy in customizing the theme and site after. And since one-click theming is so prevalent on other sites, there is more of a need for an alternative here.
One thing though, there should be some clear straightforward documentation on how to do this.

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: 65026 Total Logged-in Users: 38
Total Topics: 82116 Total Anonymous Users: 19
Total Replies: 441307 Total Guests: 198
Total Posts: 523423    
Members ( View Memberlist )
Newest Members:  meenoiYang.JianuoioitsukiNathan HammondalexcigadamstaneckiLucas Mayscybermilltstitt