I have been looking through the modules and the issue queue for something that provides a "current domain" context through ctools. I have not found anything yet.

Before I begin writing a context plugin, is there a compelling reason why one shouldn't be created?

Thanks,
Noah Lively

Comments

agentrickard’s picture

Project: Domain » Domain CTools
Version: 6.x-2.x-dev » 6.x-1.1
Category: task » feature

No reason at all other than time. It should be a patch against this module, though, which is split off from the main module for faster development.

Unless Domain Ctools actually has what you need, which I doubt.

Current domain is a global value that most things are sensitive too, so I don't quite now what you would gain with a Ctools context. There is also a context module plugin. http://drupal.org/project/domaincontext

noahlively’s picture

Panels selection rules was the application I wa thinking of.

agentrickard’s picture

I don't think I have messed with that. Take a look at what Domain CTools provides, and patch against HEAD as needed.

noslokire’s picture

I needed the same, however if you have the Token module installed, which most do, you can use the Token context and make the identifier "Domain" and the Keyword "domain" and magically the domain variables appear.

I used the %domain:domain-subdomain-raw to get the sub-domain name

agentrickard’s picture

I suspect that is the proper solution, yes?

neilnz’s picture

I think it would be neater to have a proper context plugin for this.

My use-case is that I use the panels cache, with context-based granularity, with the same panel on different domains. Inside the pane are views that are domain-sensitive, so when the panel caches on one domain, it caches then spits out the wrong view content on the other domain...

Tokens are a bit of a hack...

agentrickard’s picture

Those are two different issues, really.

Patches welcome.

agentrickard’s picture

Version: 6.x-1.1 » 7.x-1.x-dev

Bumping

rogical’s picture

Really need this!

jwilson3’s picture

Following the instructions in #4 no longer works the same way in D7 because you'll end up with tokens that look like %domain:current-domain:subdomain, etc.

For Drupal 7, I suggest adding a Panels CTools context of type Token, with Identifier: "Site" and Keyword: "site", and you end up with tokens like %site:current-domain:subdomain, %site:default-domain:subdomain, %site:current-user:name, etc.