Hello,
I need to design a site that has a frontpage with buttons that send the user to different "sites", for example:
1 button will go to Graphic Design and the other button will go to Judaic Art.
These button should open different pages that look as it these are two different sites.
I don't know how to create the different looks to all the pages.
I've created a frontpage cck, but how do I make it that each "site" has a different look?
For example, different picture in the header, different look to the menus etc.
The frontpage also has a button for About, how do I do it that the about page has a header with a background pic and the front page doesn't?
I'm using a zen subtheme and tried all kind of options like:
- In my subtheme template.php file I wrote this:
function rrdesigns_regions() {
return array(
'content_top' => t('content top'),
'content_bottom' => t('content bottom'),
'footer' => t('footer'),
'closure_region' => t('closure'),
);
}
Still the header appeard.
Then, I tried something else, I copied the page.tpl.php file and saved it as front-page.tpl.php. In the file I commented the lines:
print $head; and all kind of other lines, nothing helps, any change I do in the front-page.tpl.php file doesn't reflect on the site.
The front-page.tpl.php is in the subtheme directory.
My default front page is pointing to /node, if I change it to I get: page not found.
So I have many questions, and very confused, so can someone point me to the right direction of how to deal with a design like the one I need?
Different design for frontpage and for "2" different sites.
Thanks,
Sigal

Comments
Meanwhile
For now I decided to create the front page outside of Drupal and create two different drupal installation for the 2 different sites that will be called from this front page.
If anyone has a better idea, please let me know :)
Thank you,
Sigal
Multiple themes
Hi there.
I've played around with the Taxonomy Theme module
You can then use Taxonomy terms on content to differentiate, or specify by Path.
Works well.
For your front page, have a look at the FrontPage module (although you could probably do all using Taxonomy Theme
Good luck!
Emile Botha
www.ServeLime.co.za
Entrepreneurship is a journey to a fulfilled life - make it so.
PS: I'm looking to establish partnerships with Drupalers in SA. Drop me a line using the Contact Page if interested. ;)
Emile Botha
Entrepreneurship is a journey to a fulfilled life - make it so.
I'd avoid setting up 2 separate sites if possible
And I agree with the above comment - something like taxonomy theme. I've never used it, but it looks like you could even change the theme for different node types...
http://drupal.org/project/taxonomy_theme
Depending on your requirements you can also create a different node template for different content types: http://drupal.org/node/17565 but I think you're talking more on a global theme level.
PHP template is king
To theme the front page with PHP template, use the front page template (from http://drupal.org/node/104316 explaining how to use different page layouts depending on the path):
I recommend using two seperate themes, however. Two themes will allow you to select blocks depending on the theme used, which will allow a lot of customization depending on which section you are on (I also agree that using a module to select the theme would be the way to go).
If the differences are small or subtle (like only changing the header), I'd stick to some conditionals in my page templates, with some functions in template.php
(this is all based on Drupal 5.x)
e.g. Selecting a random header image out of 5
In page.tpl.php:
<img src="<?php print $base_path . print $directory ?>/images/bc_promo<?php print ThemeName_rand(); ?>.png" alt="Current ATL Promo" />Then in template.php
/** Generate a random number beteween 0 and 5 */
function ThemeName_rand() {
srand(time());
$random = (rand()%6);
$random++;
return $random;
}
Thank you
Thank you all,
The 2 sites are going to be completely different, one is for the Judaic Art and the other is for the Graphic design.
I will have a look at the taxonomy_theme module.
I looked at the front page module before but what I understood from it is that it gives you the option to display different front pages by user, and I'm not interested in the user but in the site he is looking at.
Am I wrong?
Thank you very much, I'm surprised you even understood my questions, felt it's all over the place LOL
multi-site?
Hi Sigal
You have two aproaches.
1. Create 3 sites with multi-site on one installation. If you use Cpanel: http://drupal.org/node/125539. I can also send you a module that will do the symlink. I use this, can help with that.
Quentin
www.webnthings.co.za
Quentin
fontpage
Ok, I'm struggling, just a reminder I'm using zen subtheme.
I created a node and promoted it to frontpage.
In my site information, my frontpage points to: node
I copied the page.tpl.php file and saved it as: page-front.tpl.php in my subtheme directory.
Now I want to go step by step.
First I want to remove the page title, in page-front.tpl.php I did this (commenting the php code that prints the title):
<?phpif ($title):
?>
<?php//print $title;
?>
<?phpendif;
?>
The code here is breaking when I'm posting the message, so I hope you'll understand what I did.
The page title still appears.
Any change I do in the page-front.tpl.php does not appear on the site, even tried to just add text in a few places, nothing happens.
So where do I go wrong here?
Thank,
Sigal
Sigal Are you not confusing
Sigal
Are you not confusing page.tpl.php with node.tpl.php?
Remember page.tpl.php is the main template for Drupal that contains headers, sidebars, footer, and the content which contains the nope.tpl.php
Quentin
www.webnthings.co.za
Quentin
Confusion
I'm probably confused out of my mind by now...
Right now, my site has 3 subthemes already:
1 for the front page itself
2 for the pages called from the front page (Since I couldn't figure out how to put a picture in the header only for the pages and without it appearing in the frontpage)
3 for the "frontpage" of the Judaic Art site
Whatever I tried, I couldn't get rid of the page titles or the breadcrumbs or different headers unless I created these 3 subthemes.
I looked at page.tpl.php and node.tpl.php and page-front.tpl.php and the only way it worked for me is with 3 different subthemes and I'll probably need to create 2 more 1 for the graphic design "frontpage" and one for the graphic design content pages.
Do I make sense?
Sigal
Still: why not multi-site?
Hehe, just kidding.
It sounds to me you are trying to create two web sites on one Drupal installation. With a front page. right?
You are trying to do it by creating nodes with different headers and titles? And themes?
Again, I would recommend for you to look at multi-site. It is one Drupal installation on a server. You then create links to the sub sites. Each site will have its own set of database tables (you can even share tables, but that can get a bit confusing. not needed) on the same database.
But each site will operate as if it is a new Drupal installation. So you can set up and customise nodes and themes for each site.
www.webnthings.co.za is my main site. ubercart.webnthings.co.za, iv.webnthings.co.za and a few more other sites are on the same server on one Drupal installation.
Quentin
www.webnthings.co.za
Quentin
Multisite
Hi there,
My client does not want to register a different domain to each site, that's why in my first post I said "sites" in quotes since it's not 2 different domains.
So, I'm not sure multisite is what I need?
No need to register
You don't need to register more domains.
Say, your client registered www.mysite.co.za then www.mysite.co.za will be the main site where you put up your front page with links to other pages and stuff.
Then, with multi-site, you create judaic_art.mysite.co.za and graphic_design.mysite.co.za.
Each is a full blown site on its own but on one domain, one Drupal installation and one server.
Quentin
www.webnthings.co.za
Quentin
htaccess or apache config changes?
Sounds pretty simple Quentin, but does it require any changes to DNS or the apache configuration file, or .htaccess?
Windows or Linux server
I'm not an server expert, just go on what I've read in the docs. I use a Linux server. There I only have to create a php symlink without making any other changes to files except check that Options +FollowSymLinks is set in .htaccess.
From what I've read about windows local and server, you have to create virtual hosts in Apache httpd.conf. Symlink does not work with Windows.
It is easy once you know how to setup your own server for it. The biggest problem is to figure out how to redirect to your multi-sites, seems like there are many ways to skin a cat. Best is to read all the docs:
http://drupal.org/node/43816
http://drupal.org/getting-started/5/install/multi-site
http://drupal.org/getting-started/6/install/multi-site
Quentin
www.webnthings.co.za
Quentin
Could this be problematic on shared hosting?
I'd be interested to hear if anyone has managed a multisite drupal install on shared hosting?
There could be issues with them not wanting to create symlinks or set up sub-domains...
It might not be a problem
Depending on the level of access your shared hosting provider gives you, it seems like multisites should be possible on shared hosting.
The cireteria seem to be:
Shell access with the ability to create symlinks (this can also be done using php), OR
Ability to create parked domains.
Some instructions are available here: http://community.contractwebdevelopment.com/drupal-multisite-configurati...
hosting
Nice article.
Providers have their own ideas on restrictions. If your provider does not want to play with, then change. I've done that and glad I did.
You also don't need to have command line access to do a multi-site or need to edit any file. I use Cpanel on a Linux server and this is my procedure in a nutshell for Drupal 5:
Copy settings.php from sites/default folder from your installation source. (ie: where you install Drupal from) Save for later.
Install Drupal normally. I share one database (normal for shared hosting) so note db name, user and pw for later.
Create sub domain in Cpanel ie: sub1.mysite.co.za
Delete the sub domain folder with FTP client (symlink will create own folder later). But do not delete subdomain in Cpanel.
Create a new folder under your drupal /sites folder, name it sub1.mysite.co.za.
Copy the settings.php you saved above and and paste it in the folder you created.
I've created a module to do symlink (attached). Start your main site, install module and open it from the admin menu. Enter only "sub" in the text field and click create symlink. If you get an error, either you did not follow the above or you have already created the symlink. (This module is only a tool, I did not put in any checks to prevent errors).
now start your new site: http://sub1.mysite.co.za. If everythings is done right, you should see a new Drupal installation starting up. Enter the same db name, user and pw as your main site. Click advanced settings and enter a unique table prefix for your multi site, ie: "sub1_"
Continue as if you are setting up a new Drupal instalation.
Thats it. :)
I still have to do multi-link on Drupal 6. Will do that soon (need it for myself) and post it here.
Quentin
www.webnthings.co.za
I can't attach zip files, here's the code for the module (I'll email to anybody if they have problems building a module)
info file
; $ID$
name = "Symlink"
description = "Create a symlink to be used with multiple sites creation with Cpanel."
package = "Multi-site"
module
<?php
// $Id$
/
* @file
* Create a symlink to be used with multiple sites creation with Cpanel.
* Development sponsored by .
*/
/*******************************************************************************
Hook Functions (Drupal)
******************************************************************************/
/
* Implementation of hook_menu().
*/
function symlink_menu($may_cache) {
if ($may_cache) {
$items[] = array(
'path' => 'admin/settings/symlink',
'title' => t('Symlink'),
'description' => t('Create or delete a symlink for multi-site'),
'callback' => 'drupal_get_form',
'callback arguments' => array('create_symlink'),
'access' => user_access('administer site configuration'),
);
}
return $items;
}
/*******************************************************************************
* Callback Functions, Forms, and Tables
******************************************************************************/
function create_symlink() {
$form['symlink_name'] = array(
'#type' => 'textfield',
'#title' => t('Link Name'),
'#description' => 'Enter only the sub name. So for "foo.mypage.com", enter only "foo"'
);
$form['submit1'] = array(
'#type' => 'submit',
'#value' => t('Create symlink')
);
$form['submit2'] = array(
'#type' => 'submit',
'#value' => t('Delete symlink')
);
return $form;
}
function create_symlink_submit($form_id, $form_values) {
//drupal_set_message('<pre>' . print_r($form_values, TRUE) . '</pre>');
if ($form_values['op'] === 'Create symlink') {
symlink(".", $form_values['symlink_name']);
drupal_set_message($form_values['symlink_name'] . ' has been linked');
}else{
unlink($form_values['symlink_name']);
drupal_set_message($form_values['symlink_name'] . ' has been unlinked');
}
}
Quentin
Seems like the parser is
Seems like the parser is getting confused here. In above:
* Implementation of hook_menu().
/
function symlink_menu($may_cache) {
Should be:
* Implementation of hook_menu().
*/
function symlink_menu($may_cache) {
Note the */
Quentin
www.webnthings.co.za
Quentin
Good stuff Quentin
Thanks Quentin - this is great info :-) It's good to know it can be done using CPanel.
www.parkroad.co.za/blog
Hi foxtrotcharlie , I run a
Hi foxtrotcharlie ,
I run a multisite installation with about 20 sites on a virtual server.
Here are 2 of them:
http://www.laserhairremoval-info.com/
http://www.home-remodeling4u.com/
Create 3 Zen Sub-themes + Blocks page for each
Emile Botha
Hi Sigal.
Create your 3 sub-themes (can be identical)
For each then configure your block layout (each theme has its own blocks layout.
For better control over content you can use the nodebock (node as a block) to position it very specifically.
Also remember tyhat you can specify a set of Onmly-show / not-show URLs for each block (under config)
Cheers
Emile
www.ServeLime.com
Entrepreneurship is a journey to a fulfilled life - make it so.
Emile Botha
Entrepreneurship is a journey to a fulfilled life - make it so.
I think I'm getting somewhere
I restarted everything.
Now I use the taxonomy_theme module.
I've created one subtheme for the front page, one for the pages that will be called from the front page (About etc.) and then I will create one for the Judaic art and one for graphic design.
Up to now, looks fine.
Am I doing it the right way?
not sure if this will help
I was reading this http://drupal.org/node/45944
It says you can add this to your page.tpl.php
<?php
/**
* This snippet loads up different page-type.tpl.php layout
* files automatically. For use in a page.tpl.php file.
<em>
</em> This works with Drupal 4.5, Drupal 4.6 and Drupal 4.7
<em>/
if ($is_front) {/</em> check if it's the front page <em>/
include 'page-front.tpl.php'; /</em>load a custom front-page.tpl.php <em>/
return; }
if ($node->type == 'book') {/</em> check if it's a book page <em>/
include 'page-book.tpl.php'; /</em>load a page-book.tpl.php <em>/
return; }
if ($node->type == 'blog') {/</em> check if it's a blog node <em>/
include 'page-blog.tpl.php'; /</em>load page-blog.tpl.php <em>/
return; }
if ($node->type == 'image') {/</em> check if it's an image node <em>/
include 'page-image.tpl.php'; /</em>load page-image.tpl.php <em>/
return; }
if ($node->type == 'forum') {/</em> check if it's a forum node <em>/
include 'page-forum.tpl.php'; /</em>load page-forum.tpl.php <em>/
return; }
include 'page-default.tpl.php'; /</em>if none of the above applies, load the page-default.tpl.php */
return;
?>
Ok by this example if you make a page-graphic.tpl.php and a page-judiac.tpl.php and mod this code to include
if ($node->type == 'graphic') {/* check if it's a forum node /
include 'page-graphic.tpl.php'; /load page-graphic.tpl.php */
return; }
and another for the judiac then shouldn't that let you load the different templates for each site? I am new to this but so I might be WAY off but makes sense to me. You might need to create the pages on the different sites using CCK and views to get the node type to be 'graphic'
I would suggest, and I have
I would suggest, and I have created a site needing a different style for each page ( i think the client was on drugs ... ) you use ccs injector.
If you use pathauto (which I highly recommend) you could assign each navigation area to a url specific set. So one would be www.whatever.com/jart/ then the graphic design would be www.whatever.com/gart .
Each page created, for each section, is assigned the url needed through the url_alias UI in drupal, which comes with pathauto -- you also need the token module ( dont know if I have a site that does not use token). I assume you are using cck and views. So each content type goes to a different url section, aswell as pages associated with them. And if you create a view for the jart section the path settings start with jart/[title]
Then you install the css_injector module http://drupal.org/project/css_injector.
On the css injector configuration you can write your css for each section and assign it to only be set on say ../jart/* -> ../jart// -> ../jart///* (just to make sure;) and the style for jart will then be applied to those nodes which have the urls starting with /jart.
for the front page ...views has a front page view, but I normally use page-front.tpl.php (this allows to create div's that might otherwise destoy the other pages) and create my view, then just assign that to the front page in site configuration. With the view being the front page it is very easy to pull information from both sub sections, which might come in handy when the client starts going crazy and requests the remote control of his cats video cam to interact with a low orbiting NATsat then send that live feed to every social networking site ..including myspace, with AI preconfigured editing and scrolling text.
Hope you come right