how do I put a template chooser on my site?

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
User avatar
zeroality
Forum Members
Forum Members
Posts: 64
Joined: Mon Aug 14, 2006 10:41 am

how do I put a template chooser on my site?

Post by zeroality »

I want to set up a template chooser. I tried a search for topics and modules on this and I could only find a stylesheet chooser, not a template chooser.

I want to set up separate templates so that I can design different layouts for the user to choose from. Anybody know how to do this?

I am running CMSMS 0.13.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: how do I put a template chooser on my site?

Post by Dr.CSS »

You will have to go to Dynamic Drive .com to find a JS script to use, not tested it but would like one myself.

I couldn't figure out how to change stylesheet switcher in to template switcher.
User avatar
zeroality
Forum Members
Forum Members
Posts: 64
Joined: Mon Aug 14, 2006 10:41 am

Re: how do I put a template chooser on my site?

Post by zeroality »

Looks like the CMSMS community has another module that needs to be developed. ;)

I'll check around for a script. Thanks.
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: how do I put a template chooser on my site?

Post by Elijah Lofgren »

zeroality wrote: I want to set up a template chooser. I tried a search for topics and modules on this and I could only find a stylesheet chooser, not a template chooser.

I want to set up separate templates so that I can design different layouts for the user to choose from. Anybody know how to do this?

I am running CMSMS 0.13.
To be able to choose the template id via a URL variable you could:
1. Open index.php and find this line:

Code: Select all

$pageinfo = PageInfoOperations::LoadPageInfoByContentAlias($page);
2. After it put:

Code: Select all

if (FALSE == empty($_GET['template_id']))
	{
		$pageinfo->template_id = $_GET['template_id'];
	}
3. Then make a template chooser that adds ?template_id=15 to the URL (replace 15 with the id of the template your want used)

Should get you started.

Hope this help,

Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: how do I put a template chooser on my site?

Post by Dr.CSS »

So I could use this in my index.php on line 183 and it wont mess it up?

And then find the stylesheet call in stylesheet switcher and replace it with ?template_id=, wonder if there is some way to get it pointed at the template db like it does for CSS to put in it's drop down?

  hhmmmm....
User avatar
zeroality
Forum Members
Forum Members
Posts: 64
Joined: Mon Aug 14, 2006 10:41 am

Re: how do I put a template chooser on my site?

Post by zeroality »

I'm not a PHP guru but I am definitely interested in this. Could someone finish the code above and tell us dummies how it's done? :)
User avatar
zeroality
Forum Members
Forum Members
Posts: 64
Joined: Mon Aug 14, 2006 10:41 am

Re: how do I put a template chooser on my site?

Post by zeroality »

Well, I suppose this is how threads go at CMSMS. Somebody gets you excited about something but doesn't follow up. :(

Edit: I don't mean to sound bitchy. "Oh, he didn't get his problem solved so now he's whining." No, this isn't just "my" problem. I can only imagine how many people using CMSMS would love a template switcher so I don't understand why someone can't take time to help probably 25% of the CMSMS customer base. =\
Last edited by zeroality on Tue Aug 22, 2006 9:04 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: how do I put a template chooser on my site?

Post by calguy1000 »

Are you talkking 'stylseheet switching', or 'template switching'. 

TemplateManager as of now allows you to specify prefererred, and alternate stylesheets....

Template manager would infer allowing users to specify completely different layouts for their pages.
CMS Doesn't support this at this time.

You couold have different numbers of content blocks on each template? what if one or more weren't fillde out?
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
streever

Re: how do I put a template chooser on my site?

Post by streever »

Your attitude toward Elijah and the rest of the community is upsetting. No one is obligated to help you.

My answer would have been:
simply use divs appropriately. Then, use the stylesheet switcher.

Think I'm crazy?
csszengarden.com

The whole point is that STRUCTURE (html) should be the same. CSS is where you change things.

Personally, I'm trying to come up with one layout that will work for every site I do. Then I have my css files, and just modify one of them.
Johann

Re: how do I put a template chooser on my site?

Post by Johann »

My answer would have been:
simply use divs appropriately. Then, use the stylesheet switcher.
I agree with streever, an I use this technique myself; your site must be valid, and must use css for layout (well, at least thats my point of view).
But there is a drawback on the styleswitcher: lets say, you want to deliver a different DOCTYPE (e.g. XHTML Basic for handheld users). Or you need to send a different IE-Stylesheet, enclosed in a conditional comment. Or you want to use different JavaScript (for instant, if you use JS to compansate IE incapabilities).
For that a templateswitcher would be quite usefull.
Post Reply

Return to “Layout and Design (CSS & HTML)”