Hi

I've rummaged around and read all the different ideas for having different themes for different pages, and specifically I have the need for a micro-site within a main site I'm working on.

The key is to be able to know whether I'm in the micro-site or not and this is where things get a bit hard.

In an ideal world I'd like to have a different URL like this:

http://www.mainsite.com/ -- for the main site and
http://www.mainsite.com/microsite/ -- for the micro-site.

I don't think that's possible with drupal, but if it is ... is it?

Any ideas?

Steve

Comments

kvaes’s picture

Depends on how you view a microsite... Maybe try to go for the autopath module, in combination with panels?

http://www.kvaes.be - http://www.artistiku.com - http://www.tuxsolutions.com

SteveTurnbull-1’s picture

Unfortunately not much help, plus this is a commercial website so I can't really use an alpha.

A microsite, in this instance, has a completely different theme.

Currently the only option I see is having every microsite page prefixed with usite-pagename which will allow me to check the URL.

xjm’s picture

There are lots of different ways to do this in Drupal. You could customize your template.php file to handle different templates based on the path, or to add a path-based CSS class to the body tag; or you could use a contributed module. For starters, take a look at Taxonomy Theme:
http://drupal.org/project/taxonomy_theme

SteveTurnbull-1’s picture

Unfortunately having so many methods is part of the problem, sometimes drupal can be just too versatile. I'm looking for the method that's going to work the best for me.

For example, the main site will have its own theme with all my added CSS, how do I persuade it to load a different CSS file having decided we're in the micro-site?

All help welcomed :-)

xjm’s picture

Well, one easy way with the taxonomy theme module is the use of subthemes. My theme is based on the structure the Zen theme uses.
http://drupal.org/project/zen
This theme allows you to add "subthemes" with their own templates and CSS. If the templates and CSS are not there, then the main theme's CSS is used.

I've used this in the past to create a subtheme--which is basically just a subdirectory containing an additional php file and CSS file--and then used taxonomy theme to apply this subtheme to special subsites (of which one of my current Drupal project has several).

You don't have to use subthemes to do this--you could also simply copy the whole theme directory for your existing theme, rename it, rename the theming functions, and then add your separate CSS file there.

I'd recommend trying taxonomy theme to start with, since it's a pretty versatile module and is fairly easy to use. If that doesn't fit for you, a more customized theming approach might be more the thing.

Quint’s picture

What is your definition of a micro-site? Have you thought about doing this in a multi-site setup? It would be entirely discrete -- it's own content, users, theme, etc.

Quint
Remodelling

SteveTurnbull-1’s picture

No choice on that, unfortunately.

inders’s picture

Hey..

We can have multiple drupal instances under mainsite all driven through few common tables.In this way we can handle multiple drupal installs like microsite.

Not sure if i am right as iam not clear about microsite.

---
Inder Singh
http://www.Indiapoly.com

Inder Singh
http://indersingh.com

akora76’s picture

Hi,

I think you'll need the ThemeKey module (http://drupal.org/project/themekey). This allows you to specify a pre-created theme for a unique path, e.g:

www.mainsite.com < main theme
www.mainsite.com/microsite1 < has a different theme
www.mainsite.com/microsite2 < has another different theme

The good thing is that if you create a page "underneath" it will inherit that particular theme, e.g.:

www.mainsite.com/microsite1/page1 < will be themed using the theme you applied to the /microsite1/ "page/section".

Hope it makes sense.

Andras

SteveTurnbull-1’s picture

Thanks - we're using D5 so went with Sections in the end.