Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: tsmalmbe on February 15, 2008, 05:30:17 AM

Title: Changin the template for ONE page (search) based on the domain
Post by: tsmalmbe on February 15, 2008, 05:30:17 AM
Hi,

I'm redeveloping the search-page by for instance integrating my own wiki, google and ebay. My current forum is at www.domain.com. For my forum users, coming from this domain, everything should be business as usual. BUT, now I would like to add a new domain search.domain.com. I can create the domain, and  add a redirect with htacces or with a meta-refresh to get directly to the search-page. But what I would like to achieve is a different template (simple, googlelike UI instead of the forum) when the search-page is accessed this way.

What would  be my best  options here? I need to check http-headers that clear to me. But what would be the place to intercept the templating process? If I make a new action, I could  have a "mirrored" template instead of the current search, but can I replace the  basic forum  UI that way, or just the search-template? Should I  hack into my index.template.php to intercept? Or hack inte Load/LoadTheme, a bit like WIRELESS, but instead naming it SEARCH?

Comments ple-ease!

Title: Re: Changin the template for ONE page (search) based on the domain
Post by: Kays on February 15, 2008, 06:50:57 AM
A very simple solution, add ";theme=x" to the url where "x" is the number for the theme you want to display.
Title: Re: Changin the template for ONE page (search) based on the domain
Post by: tsmalmbe on February 15, 2008, 07:26:53 AM
Ooof. That's true. I thought that wouldn't work, because I have disabled the possibility for users to change the theme.

So the approach would be to use htaccess to redirect so that the URL doesnt't change (I don't want do reveal the possibility to change themes), and  make a Theme with no menus and no bs, just the search basically.

I'll get on with it and share if anyones interested.