Hi all,
I have a suggestion for the use of Source domain.
Lets assume you have some domains and you share content over all domains. But you want only one node to be avilable only at one domain. Teasers are available on all domains.
I select "Send to all affiliates". And I also check the source domain to be e.g. domain B. So all links direct to domain B.
But that does not prevent, that the node is available also on domain A and C. That is not quite good.
In short words: I want to have teasers and data available over all sites. But the node should only be available on the Source domain.
Additionally an 301 could redirect to the correct domain.
I think that would be an important feature with less effort to implement. What do you think about it?
Kind regards
Jan
Comments
Comment #1
jan.s CreditAttribution: jan.s commentedDuplicate of http://drupal.org/node/714986
Comment #2
jan.s CreditAttribution: jan.s commentedComment #3
jan.s CreditAttribution: jan.s commentedTo do a 301 redirect:
See: http://drupal.org/node/772406
Comment #4
ozalee CreditAttribution: ozalee commentedHi jan.s
How do you implement this?
Comment #5
ozalee CreditAttribution: ozalee commentedTried to put it in a module,renaming the function. No success.
Comment #6
ozalee CreditAttribution: ozalee commentedOk, i just put the code at the top of my node--product.tpl.php.
Probably not the best way.
Any advice welcome.
Comment #7
jan.s CreditAttribution: jan.s commentedHi ozalee,
I put this code in an own module ("multidomain"). So the function must be named "function multidomain_init()".
Have you cleared the cache after updating your module so that the init hook was registered?
Its working fine for me.
Comment #8
ozalee CreditAttribution: ozalee commentedThe above code didn't work for me anymore since I-don't-remember-which release.
Took me a long time to get it working again as i'm a noob with php.
Hope this helps someone.
If anyone finds a mistake, i'm all ears.
Comment #9
ozalee CreditAttribution: ozalee commentedBetter (for the "Available on all domains nodes"):
Comment #10
mattwmc CreditAttribution: mattwmc commentedIs there a D6 version of this anywhere?
Update: This seems to be working: https://drupal.org/node/704568
Comment #11
lundj CreditAttribution: lundj commentedHi!
I think the code of comment #9 is not valid anymore... maybe because of the newest version of domainaccess?
The source code line
$sourceDomain = $node->domain_source;
became
$sourceDomain = array_shift(array_values($node->domains));
in my case - now it works like a charm.
Comment #12
joelrotelli CreditAttribution: joelrotelli commented@lundj You're right
Yes, the working code is :
if ($node = menu_get_object()) {
does not work if the node is not allowed to be displayed on the current domain. You have to check if you are on a node, for exemple with :if(arg(0) == 'node' && is_numeric(arg(1)) && $node = node_load(arg(1)))
Comment #13
neilp78 CreditAttribution: neilp78 as a volunteer commentedComment #14
kobb CreditAttribution: kobb commentedJust wanted to say that the code in #12 is still working as of July '16.
It seems like this should be included in the DA submodule domain_source.
Thanks, @joelrotelli & @ozalee