Groups, Spaces, Context, Features...Do I need all those?

Events happening in the community are now at Drupal community events on www.drupal.org.
harcher's picture

I'm building a website that consist of a main website and three office locations/branches websites. The main website pulls content from all three locations.

Location websites must have a 'home page' with a unique url, as well as the main website ofcourse. Each location must have an allocated admin role that can manage that location content only.

All websites must have the same structure (i.e. same navigation, sections, etc.) but different content and menu paths depending on which website is currently being viewed. They would be clones of each other. Links would would be kept within the location.

Sections are:

- Home (page type, so just title and body)
- News (list of news items. each item is from one of three locations, so OG+CCK+Views)

The site url structure:

- global website (pulls content from the three locations):
www.mycompany.com
../home
../news

- Liverpool website
www.mycompany.com/liverpool
../liverpool/home
../liverpool/news

- Leeds website
www.mycompany.com/leeds
../leeds/home
../leeds/news

- London website
www.mycompany.com/london
../london/home
../london/news

Almost there :)

I decided on using Organic Groups. After reading a few posts, I'm not sure that OG alone is enough. Or is it?

I've set the locations as three OG groups, allocated a group admin for each group. Works great for managing individual groups by seperate group admins.

However, I'm confused as to how I would go about displaying all this in the structure mentioned above.

To cut the story short:

I right in thinking that I would need ALL of the following to achieve this:

- spaces_og (not just OG)
- context
- features

Thanks for any help :)

Comments

Pretty much yes

vegardjo's picture

Hia, I would say that you would benefit from using all modules, as they are connected. You cannot really use Features unless you have Spaces (as that is where you enable or disable a feature). Context isn't needed as such, but it just makes everything easier and more flexible.

For your site: each main section could be a group space, the URLs will be made from the URL you set when you create the group. Everything under there (news, home, other) can be made by features (and Context will help you). Main site is a site space where you aggregate content from the other.

OG could be enough for this, but if you ask me these other modules have made OG so much more useful and pleasant to work with!

Why spaces is required?

merilainen's picture

I'm still new to this context-features-spaces combo, but I don't think Spaces is a requirement to use Features. Features can be activated in it's own settings page.

If I create some Features which just creates new content types, views etc, why wouldn't they come active without Spaces?

An example from OpenAtrium: Atrium Profile. I can enable it to have certain fields activated for the profile, have a new view, set all the required permissions and so on.

..it's not

vegardjo's picture

you are indeed correct, my bad :)

I haven't tried to active a Feature without a Space, but it should work as you say. Spaces still makes a lot of sense to use to easy configure / override some parts of a feature though, like the name and order of the menu item, the headings of the blocks etc.

Thank you for your replay. It

harcher's picture

Thank you for your replay.

It makes alot more sence now. I'll do what you suggested and have everything defined as a feature for the different groups.

Also have you had experience using the OG_menu and/or features_menu? I've read about them and it seems that I would need to use one of those as a menu per group.

Thanks again

Haven't tried OG_menu, but I

vegardjo's picture

Haven't tried OG_menu, but I guess it depends a lot on how you would like your menus to work.

For my site I need all primary links to change depending on which space I am in, and because of that I have set "source of primary links" to the Features menu in /admin/build/menu/settings. So all links are essentially a link to a feature, and these change. If you would need a shared menu you could just build it in as usual.

Features with submenus are a bit harder. If your features consist only of Views you can build your menus (tabs) into the Views (see how this is done in Open Atrium), or you can build small menus and include them as menu blocks in Context. I still don't know what (if anything) is considered best practice here, though..

Hi, thanks again. This is

harcher's picture

Hi, thanks again. This is great, I'm starting to get an idea of how to build this.

My main concern is the menu system and sub menus (yeah I have sub menus :( ).

I'll take your advice and post any interesting findings I run into.

Me again

harcher's picture

What I have so far:

  • Created an OG group, Office Location, and created my three office instances of this group (liverpool, leeds and london)

  • Created a CCK node 'News' and gave it group type "Standard group post"

  • Created a Role 'office administrator'. Need a user account per office so that they can add/manage news items for thier office only.

  • Created the three admin user accounts and assigned the role 'office adminisrator' to them. So user accounts are: 'liverpool.admin', 'leeds.admin' and 'london.admin'. Each has thier own loggin details ofcourse.

  • Created a view 'list news' and added a menu item within Navigation menu linking to it. This view is for office admins to manage news items. Now this view must only list news items that belong to the current group, based on the current logged in office admin. This is my problem!

So, and please correct me if I'm wrong, I need to have the view link path change depending on the current logged in admin. For example:

If leeds.admin is currently logged, this menu item must be something like 'og/leeds/list_news'. If london.admin then 'og/london/list_news' and so on. Then use arguments on the view to get the current group, and list the group items only.

  1. Is this the correct way?

  2. OR is there a better way?

  3. How do I have the view link change its path based on the logged admin?

  4. For best practice, what path defenition do you use for administration views (e.g. views used for admin purposes only, listing nodes and such)? add 'admin/og/...' in the front?

I still haven't installed the modules Context, Features or Spaces. I'm leaving them out until I need them. Is this where I start needing them?

Many questions i know but this would really clear many issues I'm having and would help others :)

Thanks again for any help.

Download them!

vegardjo's picture

Yes, you are probably on the right track, but I believe all this would have been much clearer if you had downloaded the modules you need from start :)

You will need to add your views to Features, and also create group spaces where you can turn on these features. Spaces depend on a module called Purl which will do the URL tricks for you, and you will be asked to download it when you install Spaces. Best of luck! :)

I downloaded and installed them and...

harcher's picture

Ok so I downloaded them, installed and re-created the OG group type and created the three group instances with my space presets, created a view as a space feature,...and so on...and to be honest, I don't know what I'm doing :)

I dont know why and when I need a context. Setting up a view as a Feature then having it behave and do this n that is comlicated. Then clicking on links from a group caused the context to duplicated, so, can end up with liverpool/london/liverpool/leeds/node/43...Then I would also get random errors here n there...

I've been up all night and around 5am I just couldn't take it anymore...I realised that I have to avoid using these modules completly or im going to kill myself lol

So, I thought, why not have four drupal installations, each office website can be installed on a subdomain, with the main website on the root domain. I know its crazy but they are really seperate websites even though they are clones. Having one website doesnt justify the headache for this.

Those modules are too complicated in my opinion and are in desperate need for more examples/documentation and stable releases.

Thanks vegardjo and good luck with your project mate.

Aw..

vegardjo's picture

sorry to hear that, Drupal has a steep learning curve but it's usually worth it :)

If you wish to have four installs you will probably run into some other issues, like aggregating content from three of the sites on the main site, updating your sites etc. You should probably use a multi site configuration, but it's not that straight forward. Or, many people now seem to use the Domain Access module(s) to do that, but it's not dead simple either, as far as I've seen. If it is a fairly simple site you should not need to do this.

Building simple features aren't that hard when you get the logic. You can have a look here: https://community.openatrium.com/documentation-en/node/449 or here: http://vimeo.com/4902153

Context aren't needed at all to start with, so don't worry about them. You can always add them later. I suspect that your duplicate links might have something to do with the path you've given to your views? If you need a news archive, the Views path should only be "news_archive" and whatever gets before that "london", "leeds" etc will be handled by Spaces.

When you have made a space or two you can enable and administer your features for that space. The easiest way to get to these admin pages is to put this into your theme's page.tpl.php:

<?php
print $space_user_links;
?>

<?php
print $space_admin_links;
?>

..which will print out some handy links for you. Also, download Open Atrium and poke around there. It's fairly complex but you can learn a lot by seeing how they have used these modules.

Anyhoo, good luck whatever you go with! :)

Thanks for taking the time to

harcher's picture

Thanks for taking the time to explain this.

Thing is I don't have the time to learn all this. I've got another 3 weeks to build this. The website stucture is far more complex than the example I gave. Not only do we have news, we have: Clients, Disciplines (basically categories, so Taxonomy), Case Studies, People, Friends, Vacancies...And most those have a many to many relationship plus for each location. Then ALL of that needs to get filtered and aggregated (can you imagine the workflow on that!!) into the main website...It proved to be really complicated considering I've never used those modules and it's only my 2nd drupal site.

I've seen that video too and a few others from DevSeed. Trust me I've done my homework :)

"If you wish to have four installs you will probably run into some other issues, like aggregating content from three of the sites on the main site, updating your sites etc."

I thought about that. What I'm going to do is have the admins from the office websites enter content items twice (I can't believe I'm resorting to this). They will first enter (for example) a news item into the office website that they belong to, then into the uk main website. When entering into uk, they will set the state of the item to Draft, then when they are ready, they will set to Review (Workflow magic). When that transition happens, the website will send an email action to the uk admin, telling them that an item has been added and needs approval and will show up in uk (poor uk admin, shes gonna get LOADS of emails lol)

Very bad system design but it will work and might be better for SEO using subdomains :)

I'm just running outa time.

Feed api?

skor's picture

You could use the Feed API module to automatically aggregate the content up to the main site.

Packaging & Deployment

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week