Hi, I'm building a group of websites that will share some content.
I have installed the module "domain access", and almost everything works fine.
But i have a problem: i want to share some nodes across multiple sites, but i dont want to share user comments on those nodes. I explain with an example: if i have a blog post that will be published in 2 different websites, and if one user publish a comment on that node, i want that comment published only in the website where the user have post the comment.

Comments

agentrickard’s picture

Interesting but not currently possible in core because comments inherit the permissions of the node they are attached to.

See comment_link() in the API for the logic.

You might be able to override this logic, but it would require hook_link_alter() and some nasty logic. You'd also need to store per-comment domain information in your own table.

agentrickard’s picture

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

Status: Closed (works as designed) » Active

I'm interested in exactly the same thing. We have a multi-site domain access setup where the individual sites are not linked at all from the perspective of users, but we want to publish content to multiple domains for ease of maintenance. Currently we have to clone every node into a new domain which is a pain to do in the first place, and worse to fix typos later :(

I was wondering why this comments-per-domain request can't be done where comment_render() calls db_rewrite_sql(), and I'm not sure that I understand the implications of what @agentrickard was saying about comment_link(). The comment links would be the same as far as I can see, the node would still "have" all the comments posted on it as per normal, but the visibility of these comments when they are displayed should be restricted per-domain.

Originally I was playing around with prefixing the comments and comments statistics tables per domain, but there's 3rd party modules that I like (like flag) that reference comments by id, so with prefixed tables this approach looks like it would get chaotic and untenable pretty fast with non-unique comment ids, and I don't want to be prefixing table after table as time goes on and bugs come up in testing.

I'm now thinking of making one extra table of cid and domain_id and trying a JOIN on that. This would be in it's own module, I could push it back up as contrib if I do get it working and anyone else is interested, or maybe it could be merged into Domain.

I am wondering though, what is the use-case for having nodes shared across domains that are presumably largely independent entities, and sharing comment threads? It seems strange to me that this is the default behaviour of Domain and this thread has received so little attention over the past few years :/

thedavidmeister’s picture

Title: share comments between websites » ability to not share comments between websites
Category: support » feature

updating title to reflect the issue.

agentrickard’s picture

Status: Active » Closed (works as designed)

6.x is closed to new features.

thedavidmeister’s picture

Category: feature » support
Status: Closed (works as designed) » Active

Changed to a support request as there's a few questions in my last post that I'm curious about. Wasn't really expecting a new feature like this to make it into 6.x at this stage.

Also, I've had some success with rewriting sql queries but the node comment statistics are all out, so that needs work.

I think I'll post some sandbox code once I get this working in case anyone else wants to extend domain in this way.