Cloning a group and its pages?

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
briwood's picture

Hi OG folks,

I'm using OG to create a hub site with several simple subsites. The subsites will be pretty simple (at least initially). Each subsite will simply have 3 or 4 pages which will use 2 or 3 views. All of the subsites will have exactly the same pages, except with different content.

My need is to make the creation of new subsites as simple as possible. It would be ideal if a privileged user could go to the Groups Directory (/og). To the right of the Join column in each group row they would have an Actions column with a Clone link (like we do at admin/build/views). (Export functionality would be useful, but not as nice from the user perspective.)

The tricky part is what happens when the user clicks Clone. For now I'm trying to keep it simple:

  • A copy of the group node would be created
    • The user coping the node would have to provide the new group name via a form
  • The pages associated with a group would be copied
    • the copies of each page would preserve the following elements associated with each page
      • panels
      • views
      • views panes data

My imagined process assumes that the views involved use generic filters and/or arguments so the views themselves would not have to be copied.

Are there any tools that exist that do any part of what I describe?

Is functionality similar to this planned for OG?

I am considering an attempt at module to provide this functionality, but since I'm relatively new to OG, I wanted to check with the community first. Maybe there is a different approach to my problem that uses existing functionality?

Thanks for any info or comments!

Comments

Cloning a group and its pages?

jkeck's picture

I have found that this is possible using a mix of the clone node module and using Panels Pages as Group Homepages. These three websites helped me TONS!
http://www.tejasa.com/node/160 (Moshe)
http://www.angrydonuts.com/panels-what-is-context (merlinofchaos)
http://www.civicactions.com/blog/one_week_with_panels_2_beta_3 (civicactions)

If you create a panels page using the methods outlined in Moshe's site you can accomplish what you're trying to do. However; you cannot clone the Group Sub Pages or Group owned content. This is a good method to allow other users to create (clone) a group from a set of "Group Templates" you provide. They will get the panel layout, the settings, and the views that you assign according to your contexts by Node Type. Also, I provide my users w/ 1 blank template that they can use if they decide to create their own homepage template design.

It is kind of complicated but once a good set of Group Content Types and Templates are established, you can provide your users with a very easy way to start a group that already has some Homepage content. This is the method that I am using w/ my project and it has mostly been well received.

Hope this helps!
-Jessie

Thanks Jessie

briwood's picture

Thanks for the quick response. This looks promising. A couple of initial questions:

I'd read http://www.tejasa.com/node/160 (Moshe) recently and have been troubled that I don't see the Group Homepage Node Types select list in his first screen clipping. I've grepped recursively under modules/og for that string. I find it in some .po files, but could not quickly determine why I don't see it. I forgot to mention I'm using D5...is Moshe using D6 here? (I've been under the impression that views/panels aren't production-ready in D6...)

By "Group Sub Pages" I assume you mean the tabs like Getting Started and Attending lessons which I see here: http://groups.drupal.org/node/2191/howto

Group subpages

mErilainen's picture

Actually in that page the subpages would be also "discussions" and "lessons" on the top. I'm also having hard time to provide users a template where they could add these subpages without learning how to use panels.

On "How to"-page, there is some kind of tabbed view and javascript is used to load a different node under each tab. This would be actually ideal solution for me, if it would be possible to load one tabbed view (like this "How to"), where the first one, named home, would contain the home page of the group with panels and the rest of the tabs would be static informational pages. I guess it's impossible to do with tabbed view but somehow I need to add static subpages (like you if I understood correctly) in addition to the dynamic home page of the group.

RE: Group Subpages

jkeck's picture

The javascript tabs are done with panels-tabs, and setting the Layout Setting for that panel as tabs. I believe you need jstools too.

In the project I'm working on, one of the group templates has these tabs on the home page w/ views as the pane content. The view is looking for a specific content type and taxonomy term depending on what the tab is designed for. Then when the user creates a group part of the instructions are to create a piece of content and tag it with a term for it to show up in the relevant tabs.

So you could set up an entire layout and the appropriate views as panel tabs.
1 view could be the group home page view, (River of News, etc) and that could be the first panel tab, thus making it the homepage.

This is essentially what we have done and it can be intuitive to the user in my experience.

I hope that helps.

Great idea

mErilainen's picture

I had same kind of vision about this, but I wasn't sure how to accomplish this. This is definitely the right way to go, I think. Panels seem to offer quite much flexibility with contexts, arguments and relationships. I'm not experienced user of them yet, so I learn something new everyday. Did you have to create own view for each taxonomy term or can arguments be used to pass information to the panel? Like creating a panel when new content with some term is created.

There are some issues, like clear URL's. I guess they are impossible to maintain, when one is using tabs. Any ideas how to fix this?

Panels & Views

jkeck's picture

I typically one view for most of these tabs. I created a view specifically for these tabs and set it as a panels view (Term and Type being the arguments). When you set something as a panels view you can set where the arguments for the view should derive from. If you set the argument source to Input on Pane Configuration, then you can set the arguments when you add that view to a pane in the 'Group Home Page' panels page.

If you use this method you will maintain a persistent URL to your groups because the arguments are not being passed through the url.

How to do it?

mErilainen's picture

Can you provide more detailed instructions how to do this? I'm trying to understand how to use arguments, but it's a bit difficult. I can get all the contents of some type, which would be infopages, but how do I then create tabs in panels from their tags? As you said, every page has a different tag (chosen from vocabulary) and then I would like to have a separate tab for each tag. Then it would be easy to instruct the group admin to create these infopages and choose a tag from the list provided.

Group will have persistent URL by using tabs, but is there any way to get rid of these #tabs--middle-2 or replace them with for example "about"?

RE: How to do it?

jkeck's picture

What I did was created the appropriate views, using either Filters or Views (depending on what I want to do) A typical case is to clone the content_by_type_term view. (Or something like that), and change the name. Then I add OG Post filter and set it to Current Group.

From what I remember the two arguments are Content type and Taxonomy Term.

Once you have saved this view you need to go to admin/panels/views . Then you can find the view that you just created and add it as a Panels view. On the config for the panel view you should set the Argument Source to Input on Pane Config.

The other options in this config are for what Views options will be available when adding that view to a pane. You can limit or extend the functionality that the user will have when using your view.

Now when you add that view to a pane, you will have the options available to you that you set in admin/panels/views. You can add this to your Group Home Page Panels Page, as well as make this view available to users when they create their sub pages.

I hope this helps.

Thanks for this nugget!

briwood's picture

panels-tabs, and setting the Layout Setting for that panel as tabs

Based on this, I think I've come up with really simple solution which doesn't require cloning nodes! (In my case all of the site are supposed to have identical layouts (with varying content of course).)

Here are very quick recipe notes:

Modules installed:

  • og-5.x-7.3
  • panels 5.x-2.0-beta5
  • tabs panel style 5.x-1.5
  • jstools 5.x-1.1

Setup

  • Created og_ghp_organization view
  • admin/og/og: Group Details: Set Homepage Presentation to this view for my group node type
  • Create views that select the content for each tab that should appear on the site (Officers, Events etc)
    • Arguments:
      • Group nid
    • Filters:
      • Node Published
      • OG: Posts in current group
      • Node Type "is one of" [node type to appear on this tab e.g. "event"]
  • admin/panels/views: Create "panel views" for each of the above views
    • Argument Source:
      • from panel argument
      • Context
      • any (doesn't matter)
  • admin/panels/panel-page:
    • Add tabs_org_site (or name of your choice)
    • path = node/%
    • Layout settings
      • default panel style = Tabs
    • Context
      • add argument Node ID (leave configuation at defaults)
      • (no context)
    • Content (I'm just using single pane)
      • add the og_ghp_organization pane at top (this is the Home tab)
      • add the other panel views below in the order you want the tabs to appear.
        • you can override titles to control tab names.

Goto drupalurl/og and click on your group. You should be at your Home tab. Click on your other tabs to test them. You're done.

So now:

  • New user logs in
  • create content > organization. (sets up her organization (group))
  • create content > events (create event "custom content type")
  • create other content...

Once the group node and the content is published the site is ready.

Other notes:

View type = list view. Then use CSS to customize.

This is very useful in general and pretty sweet if you want calendar functionality: http://agaricdesign.com/sites/default/files/Groups%20Context%20&%20Bread...

node/% ?

mErilainen's picture

I was also trying to look for Group Homepage Node Types, but it doesn't exist. Ok, no problem, I can create the homepage for the groups using instructions and node/% for Group content type, but when I try to use the same node/% for my custom group types, I get an error "Path may not be the same as another panel page path." So how to create different homepages for different custom groups?

Edit: Found the solution. Only one panel page needs to be created. When you assign it to several content types, each type gets its own tab in layout, content etc.

Initial Questions

jkeck's picture

He's using D5 here, but an older version of OG.

I believe that the proper place to set this now would be at admin/og/og then you select which content types are Group Nodes under Content Types. If you're creating new content types now for the groups I'm pretty sure you can set the OG usage in the content type creation form. Although I'm not 100% on that, because our OG infrastructure was already in place before upgrading to OG 5.x-7.3.

Yes, that is what I'm talking about w/ Group Sub Pages. We've been having a lot of trouble with what jargon to use to properly explain those pages.

Very interesting stuff

mErilainen's picture

I'm creating a social study environment for hypermedia students, and these tips will help me to build some templates which lecturers can use to build their groups for courses. But subpages would be really important feature to have, because every course need to have info about lectures, practises etc.

http://drupal.org/project/og_blueprints tries to accomplish this, but is still in alpha state.