Hello,
First of all - GREAT MODULE! I can't believe it took me so long to find it.
I have a question, though. I have 3 domains:
domain.com
one.domain.com
two.domain.com
I would like to achieve the following functionality:
1. When one publishes a new book_type content one one.domain.com, it will be published as well on domain.com, but not two.domain.com.
2. When one publishes a new book_type content one two.domain.com, it will be published as well on domain.com, but not one.domain.com (and so on for ALL the subdomains I will ever have - when somebody publishes on the domain, this content should be seen on that domain and the main domain, not other subdomains).
3. Nobody (except user 1, of course) should be allowed to publish book_type content on domain.com directly.
How can I achieve this functionality?
Comments
Comment #1
agentrickardYou have two options, both of which require custom code.
1) Use hook_form_alter() to auto-select the domains on the node form. This could be a little tricky, and it would allow users to change the settings.
2) Use hook_domainrecords() to always assign book_type nodes to the primary domain, which sounds like what you want. That would look something like so:
You might have to do a combination of both. Note that your hook_form_alter() implementation must fire after domain_form_alter().
See API.php in the download for details on these hooks.
Comment #2
Eli Baskin commentedUnfortunately I am not a coder, and I have no idea even what file to edit. Furthermore, won't it be a problem when I update to the next version of Domain Access?
Comment #3
Eli Baskin commentedHmm, I've read how to create a module - created my own module, installed it - but it doesn't work, no error messages and the main domain is not being added. Any idea what can be wrong?
Comment #4
agentrickard