In an earlier message you said:

Although remember that currently, theme settings are universal across all domains. That is, if you use BlueMarine for two of your domains, both of those domains will use the Blocks assigned to BlueMarine.

I have a site that lists businesses based on their country and because of that, I'd like to use the same theme for each subdomain (e.g. canada.example.com, newzealand.example.com, etc) . Is there a way to get around the issue above?

I need blocks (based on my current views) that are country specific and each subdomain should only show the blocks for that country.

CommentFileSizeAuthor
#7 blocks1.jpg234.96 KBDynamicFred
#7 blocks2.jpg206.01 KBDynamicFred
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

agentrickard’s picture

Status: Active » Fixed

Use the Domain Prefix module to create dynamic table prefixing for the following tables (Drupal 5):

-- blocks
-- boxes

This will allow you to have unique block settings for each domain. Just remember that you must be on the domain in order to store its block settings.

See the README inside Domain Prefix for more information.

agentrickard’s picture

You might also be able to use the provided Domain Views module to simply alter the block output for each domain.

jbizzay’s picture

Another quick way to do this is to use the block pages visibility settings, using php to return true to display on that page:

global $_domain;
if ($_domain['domain_id'] == 1) {
    return true;  // Display on domain id #1
}

Although this doesn't work well if you have novice users creating multiple blocks to assign to certain domains. I would like to see a domain block plugin because this module is great!

DynamicFred’s picture

Perfect!

This is EXACTLY what I was looking for. I had issues with all nodes showing up using Domain Views and this solution is much simpler.

Thank you!

agentrickard’s picture

Status: Fixed » Postponed (maintainer needs more info)

What would a Domain Block plugin do that cannot be done with Domain Prefix and/or the trick above?

DynamicFred’s picture

Sorry for not responding earlier. I just noticed your comment.

What's been happening with Domain Block is that I was getting the same menus on both the main site and the subdomain. There's other issues as well, but I just killed my test site while trying to copy the new live site data over. Once I figure out what's going on with the PHP, I'll retest and advise.

DynamicFred’s picture

FileSize
206.01 KB
234.96 KB

blocks and boxes have been copied from main site. No php code to force the correct domain as listed earlier.

Here are screen shots of the result. Note that the Canada domain shows both the US and Canada listings on the right ("Browse By Investment" and "Alphabetical List of Companies"). For some reason, on the left under "Browse by Industry", only U.S. listings appear on the Canada domain.

When I log out, I get "Sorry. No current listings" under "Browse by Industry" on both the main and Canada domains. I only get U.S. listings for both "Browse By Investment" and "Alphabetical List of Companies" and links on these blocks links point to U.S. listings although the URL still says Canada.url.com

This is on a test site, so if you like, I'd be happy to give you access so you can see everything I've set up. Maybe it'll help.

scedwar’s picture

A domain block plugin would be more intuitive and/or user friendly. We'd already tried a solution based on checking the sitename, but this snippet is clearly more efficient. However, it would be nice to have a 'domain publishing' option for blocks just as nodes are too.

agentrickard’s picture

Category: support » feature
Status: Postponed (maintainer needs more info) » Postponed

OK, so this is a feature request. Any takers?

nonsie’s picture

So what you want is for users with sufficient domain permissions to assign blocks to affiliates on block configure page?

scedwar’s picture

Got it in one! ;-)

agentrickard’s picture

This might be a little tough, because blocks can be specific to different themes as well. Not sure how to handle that part.

I would love to see someone write and release this as a separate module.

nonsie’s picture

I've been thinking about it as well and it would require it's own block permission(s). There's also the question of various domain grants. If I was just trying to make it work for myself I'd assume blocks were visible on all domains unless specific domains were chosen on block configuration screen. However this might not be the case for everyone and this possibility should be considered in a standalone module.

kevinquillen’s picture

I really need this.

We have 10 websites powered by one drupal installation. The child sites have their own theme, and therefore if have block admin access, should ONLY see their assigned theme and blocks. It's kind of late to use prefixing.

I have the same problem with Menus.

A domain should have records of assigned menus and blocks so I can give access to administrate these things for users without the risk of them altering another site.

agentrickard’s picture

A domain should have records of assigned menus and blocks so I can give access to administrate these things for users without the risk of them altering another site.

That request is beyond the scope of the project.

kevinquillen’s picture

So what can I do?

agentrickard’s picture

Version: 5.x-1.0 » 5.x-1.4

Hire or convince a programmer to implement the feature based on the API.

I simply do not have time to devote to this issue, and I generally stop at trying to rewrite permissions.

You _might_ try using Domain Prefix to prefix the blocks and menus, and also the permissions, so that your users could have different permissions on different domains.

chawl’s picture

I'm not sure if here's the right place but thread seems to be related.

We need "special pages"like "special blocks" functionality where its contents can be gathered from other domains, with the help of Domain Views filters. In particular I am trying to construct a summary block which reflects the activity on all domains and put it on all pages of all domains.

Currently, the block shows only the current domain's context as expected and filtering others out, though that's what we need on normal pages but not on some special blocks/views.

In fact, if Domain Views Filters is respected "as is", there will be no problem. I expect even if no Domain Filter is given, it should mean allow "all", but the case is not this. Module always restricts the Views content regardless of filters.

Is it possible to achieve an "allow" filtering functionality rather than "deny"?

May the Views of all types "excluded" by default from content filtering as being custom tailored objects?

Anyway, I do not want to put things with iframes and use special pages.

Sorry if I missed something. Tx in advance.

agentrickard’s picture

For 'page' views, you can set a 'special page request' in the module settings that will force DA to ignore its own access controls.

See 4.4 Special Page Requests of README.txt

chawl’s picture

Is it possible for "block" views to achieve this functionality? Because "all" pages can not be "special pages" unfortunately.

I hope I've made it clear on my previous post.

Tx for your time.

chawl’s picture

To be more clear, we need some/few "unrestricted blocks" on "restricted pages".

Sorry for confusion if any.

Edit: I have tried to put a "Page" View inside a Mini Panel of Panels module and made a block and exposed it, and put views page's path under "special pages" in settings, but no success. Views Page itself and associated block are unrestricted and correct when viewed from the path directly; but not under a restricted page as a block. I think the restriction is always pagewise.

agentrickard’s picture

You should open a new issue. This is a different problem, though I do not know of a solution.

chawl’s picture

I have created a new feature request here.

Thank you for your help.

agentrickard’s picture

For D6, I am testing a Domain Blocks module that uses preprocess functions to remove blocks that are not assigned to a given domain, but it is still under construction. And it will not work (ever) in Drupal 5.

agentrickard’s picture

Status: Postponed » Closed (fixed)
kenorb’s picture

Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.