I wonder if it's possible to automatically publish content on all domains if it's belong to a specific content type ? For example if content is a forum topic then it will be published on all domains automatically (Send to all affiliates).

There is possible for users that they can choose on what site the content will be published - permissions, I have checked: Set domain access status for all content, but...

As a Source Domain... Can it be related with forum on what user want to create a topic ? If he is creating topic on computer forum then Computer domain is select as a source domain.

I'm trying to accomplish 1 forum for all domains/subdomains and I need to simplify user experience cause it's way to much complicated for them (especially for new ones).

Comments

agentrickard’s picture

StatusFileSize
new26.45 KB

As to the first (main) question: this feature already exists. See the attached.

For the source domain piece, you would need custom code to either redirect all forum requests to a single domain or to reset the access permissions on forum posts -- which can be done with hook_node_access_records_alter().

pwiniacki’s picture

Wow. First - Thanks for fast answer! Second - This is working great!

Now I will hide those options for my users:

.node-forum-form #edit-domain
{display:none;}

(I know... it's fast non template.php hide, I'm gonna correct this later... but it work for users, cause admin can still see all those settings from backend)

Set Source domain as Use active domain setting choose as default. And we are done :) If I manage to redirect forums to specific domains/subdomains... I'm not a programmer but I guess with redirect module help I will make it:

domain1/forums/computer -> subdomain1/forums/computer
domain1/fr/forums/ordinateur -> subdomain1/fr/forums/ordinateur
but since I have more subdomains...

subdomain3/forums/computer -> subdomain1/forums/computer
subdomain3/fr/forums/ordinateur -> subdomain1/fr/forums/ordinateur

subdomain4/forums/computer -> subdomain1/forums/computer
subdomain4/fr/forums/ordinateur -> subdomain1/fr/forums/ordinateur

gonna test this ASAP.

pwiniacki’s picture

Set redirect via Global Redirect module give me infinite loops:

Oops, looks like this request tried to create an infinite loop. We do not allow such things here. We are a professional website!

Now you have 1 global forum with different theme for all you sites and users will create topic assigned to domains that you want. But cause of redirect loops don't use it on a live site.

EDIT - Related: http://drupal.org/node/1034126 -> http://drupal.org/node/1378690

agentrickard’s picture

That's a bug in Global Redirect.

pwiniacki’s picture

Status: Closed (works as designed) » Active

Sorry it was a wrong link. Again thanks for help!

EDIT: With Global Redirect you won't be able to create alias to other domain, I was using Redirect (http://drupal.org/project/redirect) module. Sorry for mistake but there is global redirect, redirect, path redirect,domain alias... and so on :) This bug is probably related to Redirect cause after unintall Global Redirect infinite loops still appear.

agentrickard’s picture

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

Status: Active » Closed (works as designed)

I have created issue in Redirect issue queue - http://drupal.org/node/1540064 let's hope it will get fixed as fast as DA issues :)

kerios83’s picture

I have similar problem. I think it's cause Redirect module use Active Domain to all redirects. Any idea how to force it to choose for redirects, domains with are not same as redirect link?

llaumgui’s picture

StatusFileSize
new799 bytes

A quick and dirty patch.

Vemma-1’s picture

The only way I could fix this after trying many patches was to open the redirect.module file and omit line #989

/** drupal_set_message('Oops, looks like this request tried to create an infinite loop. We do not allow such things here. We are a professional website!'); */

batigol’s picture

Issue summary: View changes

@Vemma - dirty, but it's 'working'. Lets hope somebody manage to fix it for good. Thanks.

pwiniacki’s picture

Well cause of https://www.drupal.org/node/905914 you don't need to use global redirect and redirect looks fine - https://www.drupal.org/node/1796596, so it's a good oportunity for tests.

NicoTN’s picture

Hi,

I need to automatically publish a specific content type to all domains but i don't find the feature on Drupal 9.

Anyone can help ?

EDIT :
I did it in custom module

<?php
function MYMODULE_node_presave(Drupal\node\NodeInterface $node) {  
  if ($node->getType() == 'myNodeType') {  
    $node->set('field_domain_all_affiliates', 1);
  }
}
?>