1

I need a Drupal 7 website with 2 sections..

for eg. www.example.com

One is Civil and the other is MEP.

Landing page with navigation to the below two sections:

section 1: www.example.com/Civil

section 2: www.example.com/MEP

Screen shots of the design:

Landing page:

enter image description here

Site -a

enter image description here

Site-b

enter image description here

The exact requirement is as follows:

/ = intro page

/site-a/ = menu and templates for site a

/site-b/ = menu and templates for site b

Separate layout and menu for these two sections. How can we keep two layout for the two sections? Is it a multisite? or just two sections?

Please suggest me a solution.

2
  • Could you please give examples of the layout for site-a and site-b? Also are we talking about "block 1" being in one region on one template, and then in a different on another template? Or, does site-a show "block and menu 1" and then site-b shows "block 2 and menu 2." Knowing the structure a bit more will help advise a direction as there are several possible ways to approach the issue.
    – blue928
    Commented Apr 20, 2013 at 9:52
  • hi,i edited the post.please check .
    – harikris
    Commented Apr 20, 2013 at 10:54

2 Answers 2

0

I think, you want to create two different website with the same domain name and same admin section.

You can add a taxonomy "site" field in all content type in the site and separate the content for both site using the taxonomy "site" field.

You can set different theme for both site using the module Themekey.

Now, you need to create three different theme, one for main website (www.example.com), second for (www.example.com/Civi) and third for (www.example.com/MEP).

You can use the views module to display the content for specific site (civil or MEP).

3
  • Could you please give me a detailed step for this? I want a website with 2 sections ,but the layout and content of each section may be different.a landing page is used to navigate to the corresponding sections.
    – harikris
    Commented Apr 22, 2013 at 9:06
  • How can we create sub directories or this link like www.example.com/Civil and www.example.com/MEP ? I used theme key for template switching and its working fine.
    – harikris
    Commented Apr 22, 2013 at 10:03
  • You can use url alias for all content type, so it will be link as www.example.com/Civil/test and you can use panels or views to create home page for the civil or MEP. Sorry, I do not have time to work on the same. Commented Apr 22, 2013 at 17:35
2

These sites look almost identical. In fact, I would say that given the pictures, the layouts are close enough to use the following templating strategy:

In Drupal, it's very easy to create a front page that will be your landing page. You will simply create a template file called page--front.tpl.php and put whatever html you want in here, exactly like you want to lay it out. This will be what people see when they come to example.com/

I know we keep calling these 'sites' but they are pages instead. Indeed 'site-a' and 'site-b' will be two 'Basic Pages titled 'Civil' and 'MEP'. In my mind these are so close I would simply have have one layout template (page.tpl.php) with the same regions, etc. It looks like the only difference is in the content. So, to handle that I would use blocks and Drupal's default functionality to force blocks to appear on one page and not others.

So far you would have to templates - page--front.tpl.php for the home page and page.tpl.php for all other pages. In the event you indeed wanted to have a different layout for pages Civic and MEP you could even have templates for these. If Civic had a node ID of 3, for example, and MEP of 4, the template names would be page--node--3.tpl.php and page--node--4.tpl.php. Please see the Drupal theming guide for more details.

Site-a menu and site-b menus:

You will have two menus created for site-a and site-b. There will be blocks for each in the Blocks section under structure. You will put both blocks in the same region (say, 'menu-region' if that's what you decide to call it). Then, edit one block to 'appear only on the following pages' and type in:

site-a
site-a/*

Then, edit the other block to 'appear only on the following pages' and type in:

site-b
site-b/*

Drupal will automatically know which menu to load. Also, each of these blocks will have their own css tags in the markup, so it will be easy to style them.

For the other sections, you would repeat the process - add all the blocks you need to appear in one regions, but edit them to show or not show based on what site (page) you are on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.