I have a multisite drupal installation. Each site has it's own settings.php file, where I define a different database table prefix for each site within the same database.

Now I would like to share some certain (not all) CCK content types and their instances between the two drupal sites.

Currently, this is possible but very complicated: If I create or update a content type within 'site A', I have to manually figure out which new database tables where created. Next I have to manually rename those tables to the shared prefix. Next I have to manually edit sites/site_a/settings.php and sites/site_b/settings.php to explicitly define that those newly created tables have a different prefix. Everytime a new field or content type is created, I have to go through this procedure again :(

I whish there was more integrated support for sharing content types, their fields, and their instances. The workflow I think of is the following:
- During creation of a new content type, you have the chance to define, if this is a shared content type and which prefix (or even which database+prefix) to use for the required database tables. You can also define if instances of this content type are shared, too.
- for every drupal site, you can define locations (database table prefixes or databases + table prefixes respectively), where to automatically look for shared content types (and their instances)
- In the case, that the drupal user tables are not shared between the sites, we need domains to separate the users and their access rights to content types and their instances (user1@site_a != user1@site_b).

What do you think about this feature? Do you think this could be useful to more people than just me? Is it hard to realize? Would it require changes to the drupal core?

Comments

moshe weitzman’s picture

Status: Active » Closed (fixed)

the supported way is with content_copy.module. you copy/paste exported type definitions.

yojoe’s picture

Status: Closed (fixed) » Active

Using the content_copy.module I can only export, the content type definitions. But this does not mean, that the instances are shared between several drupal sites.

I can create a content type 'my_content_type' on 'site A', use content_copy to export and import on 'site B', but if I create a new instance of 'my_content_type' on 'site A', this instance is not automatically available on 'site B'. So the feature I request is not Import/Export support for content types, but shared database tables support for content types between multiple drupal sites.

yched’s picture

what you ask would probably require some (non minor ?) changes in the way drupal handles table sharing across multisites, which is designed for 'static' tables.
CCK is the only module i'm aware of that defines a dynamic set of tables, depending on the admin's actions (field definitions and settings).
I'm not sure I see that happening soon, so I guess for now you're stuck with the workflow you describe in your original post...

moshe weitzman’s picture

Status: Active » Closed (works as designed)

well said. feel free to restate this request and file against core Db layer.

voipfc’s picture

subscribing

yonailo’s picture

subscribing

Manonline’s picture

I'm currently sharing CCK Content Types and I need to share the nodes and field values to. The content types and fields are shared ok, but the field value doesn't appear. Anyone know what I need to do?

Manonline’s picture

Status: Closed (works as designed) » Active
KarenS’s picture

Status: Active » Closed (won't fix)

Too complicated and too late in the D6 cycle for such a big project.

Dublin Drupaller’s picture

stumbled across this while looking for something else. is it possible to use features.module to create a content_types.module that is shared across your multisites?

in other words..put the content types + fields into code, rather than the db.

dub

rootical’s picture

Yeah, features is the right thing