Is it possible at this moment to create spaces based on the current sub/domain? I tried setting the site space modifier type to subdomain in the PURL settings page, but when I chaged my domain to a subdomain nog new space was registered.
If I understand the readme correctly then Spaces onlu support path prefix spaces?
How difficult would it be to integrate support for subdomain? Can this be done by changing a few lines in the current spaces_site module, or will this require a separate module all together?
As an extra step, it would be nice to be able to integrate spaces/features configuration for the domains configured in the Domain Access module http://drupal.org/project/domain
Could you point me in the right direction? I would love this functionality as soon as possible, but I am unsure where to start since I am new to the whole spaces/features concepts.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | spaces_domain.zip | 2.35 KB | stijndm |
| #13 | spaces_domain.zip | 2.15 KB | stijndm |
Comments
Comment #1
stijndm commentedJust to be clear:
I think a first step would be to modify the current Site Space to work with either the sudomain or the domain PURL modifier type. (This could be extended to organic groups for instance, in combination with the Subdomain module. http://drupal.org/project/subdomain)
In a next step we could extend the Site Space, or create a new space type that integrates with Domain Access.
What are your thoughts on this?
Different approach, out of scope?
Comment #2
yhahn commentedThe way we've done this in the past is to switch the PURL method to subdomain - so that your groups would be at foo.domain.com rather than domain.com/foo. Basically, it should be possible to handle this entirely at the PURL level with no particular changes made to spaces.
With the new branch of PURL, the code to handle subdomains is largely untested though, so it's possible that it's not working at all.First task here is to evaluate the state of subdomain handling and fix if necessary. Switching projects.
Comment #3
stijndm commentedI have been doing some more tests but I can't get it to work.
I started printing out values in the purl_init function and my somedomein seems to be recongnized, but nothing is registered.
I am a bit at loss in the code, I haven't had the time yet to fully understand what all the functions and classes do and how spaces uses purl. I'd love to get this working as soon as possible. If you have any idea what the issue might be, please point me in the right direction.
Comment #4
TKS commentedI can confirm that PURL subdomains are not working for our project, which entails:
- PURL 6.x-1.0-beta3
- Spaces 6.x-2.0-beta3
- Trying to use subdomains for Spaces OG group-spaces
Now *why* it's not working, I don't yet have the foggiest.
The group node gets created, and the modifier is registered at /admin/settings/purl/list (Provider=Group Space; Modifier: asp; ID: 1139; Method: Subdomain). But upon submission, I'm immediately redirected to asp.sitename.com/node/1139/spaces/features, and hit with a Page Load Error: Firefox can't find the server at asp.sitename.com.
Any attempt to jump directly to the node, or to sitename.com/node/1139/edit, also redirects to the asp. subdomain and generates the same error.
I notice that there are beta4 releases of PURL and Spaces out in recent days, and will upgrade those tonight. But is this a PURL bug? Or a sign that something on our server itself is configured in a way that isn't playing nicely?
Happy to test further, if you have any suggestions for troubleshooting requests.
Comment #5
yhahn commentedHm, well if you are being redirected to
asp.sitename.comthen it is working. You'll need to start digging into your (Apache?) server config and make sure you're set up properly though.Apache config isn't my strong suit, but there's a cool website you can use to get help on this ; )
Comment #6
TKS commentedThanks Young! Especially for the helpful link.... :)
Comment #7
stijndm commentedSo if it is working for OG subdomains, then the issue in my case most likely is related to the spaces_site.module which doesn't register subdomains?
The problem is that I'm not sure how it would be registerd. With OG it's on creation of a new group. But how do I create/register a new 'site'? If I create a subdomain and point it to the same drupal install nothing happens when I visit that subdomain. No modifier is registerd, (but PURL does recognize the value of my subdomain). I tried manually adding it to the database, but this doesn't work either.
Is it possible I have to add a folder + settings.php for each subdomain?
Maybe we do need to create some sort of domain spaces module as mentioned here http://drupal.org/node/551472?
Comment #8
yhahn commentedstijndm: you should use spaces_og or spaces_taxonomy if you're interesting in running multiple subdomains as spaces.
The key thing to understand is that spaces separates your Drupal IA from the actual physical location of the space on the web. So an OG group or taxonomy space are perfectly good candidates for living at
foo.mysite.comormysite.com/foo- you just need to switch PURL to use subdomains rather than path prefixes.I apologize for the confusion, spaces_site is rather ambiguously named. Spaces_site simply means that spaces treats your entire Drupal as a single space, rather than segmenting it on group, term, user, etc.
Comment #9
stijndm commentedThanks for the quick reply. I think we'll have to find a different solution for our problem. Maybe hook in to the domain.module + spaces to create some kind of provider. OG and taxonomy aren't possible because each subdomain will have it's own content database, with a central configuration hub (features). OG is one of those features.
I'm sure we'll figure something out. If you have any pointers that might help us out, do tell.
Comment #10
stijndm commentedOk, so I created a spaces_domain.module which leverages the domain.module and the spaces.module. Now, when I add a new domain a PURL modifier is registerd. When I go to my subdomain and print out the spaces_get_space() in my page.tpl my subdomain is recognized as it's own space.
Know the only thing that remains is to setup the features configuration page. But I got this far, so I doubt the next step will give any problems.
When I get this working nicely and I got the code cleaned up, is this something you might be interested in?
Comment #11
pasqualleof course, please share any useful solution. as it is a specific request, there is no guarantee that it will be committed, but it will be reviewed.. the solution could be more interesting than the problem itself..
Comment #12
jtsnow commentedMy colleagues and I have also started working on a spaces_domain.module! We have got the features configuration page working as well as an interface for setting up and selecting presets for domain spaces. What we haven't got working yet is the PURL modifier aspect, so perhaps we could combine efforts?
Comment #13
stijndm commentedIt's been a while, I've been working on a different project, but before the switch I made a small module that integrate the Domain Access module with Spaces. It's to do what I want (and expect).
I have only tested it with the modifier set to subdomain, but I assume it will work fine when set to domain. This only allows you to configure spaces for new domains added via the domain access interface. It does not auto detect already created domains. You still need the spaces_site.module to configure your main/default site space.
So, what do you think? Am I doing something very wrong?
Comment #14
colorado commentedI installed this module in sites/all/contrib and get the following error upon enabling the module:
Fatal error: Class space_domain contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (space::user_links, space::admin_links) in /home/mysite/public_html/sites/all/modules/contrib/domain_spaces/spaces_domain.module on line 140
Comment #15
yhahn commentedSo, spaces_domain is a nonstarter concept. In particular, a space type shouldn't specify what PURL modifier type it wants to use -- that's a purposeful level of abstraction.
It sounds like what you may be interested in is using OG, taxonomy, or writing a custom space type (that groups content by some other facet) and assigning that to use the domain modifier type.
Comment #16
stijndm commented@colorado
The error above is due to a newer version of spaces. This has been fixed for a while in our code.
@yhan
I'm not fully with you on why this is a nonstarter concept.
What we are doing now, successfully, is using the domain module as a way to group our content. Each new domain added to the site via the domain module is defined as a new space in which we can enable/disable features.
Comment #17
yhahn commented@stijndm: you're definitely welcome to continue using your spaces/domain integration. What I was trying to point out above is that domain access is not designed with the kind of abstraction that spaces thinks should be possible. Spaces assumes your space types are PURL modifier-agnostic, meaning that any space type should be usable with any of the other PURL modifier types. This means you can (and we have) used OG spaces, taxonomy spaces, etc. with the domain modifier, subdomain modifier, path prefix modifier, etc.
Since domain access is meant to be used only with domains, it isn't a suitable space type for inclusion in the spaces module.
Comment #18
colorado commented@stijndm
Thank you for your response.
Are you saying that there is a newer version of spaces_domain that works (without error) with the current version of spaces? Or that there is a bug in the current version of spaces which is causing the error?
Comment #19
stijndm commented@yhan
Thanks for the explanation. You're right, we are abusing the concepts a little. The problem we had was we needed to be able to use al those features (og, taxonomy, etc) within a grouped context/space. And we wanted to be able to turn these features on and off per space.
Maybe it would've been easier/better to extend the domain module. I'm not sure. But sinces spaces already has a proven framework it really wasn't that much work to use that as a starting point. The site has a fairly complex architecture with a lot of shared settings and some dedicated settings.
@colorado
we have a fixed version that works with spaces 2 beta 6
in attachment
Comment #20
amir simantov commentedFrom the conversation above I understood the issue is about sundomains, so I would like to get info about full domains. Is spaces module capable of handling different domains altogether as domain access does? That is, example1.com, example2.com, etc. - as spaces?
Thanks!
Comment #21
colorado commentedHello Amir-
Did you ever figure out the answer to this question? This is what I am needing to do, but there seems to be no documentation that addresses it.
Thank you,
Jennifer
Comment #22
colorado commentedI figured it out:
To use multiple full domains (i.e. http://site1.com, http://site2.com, http://site3.com) each as a different site, I "parked" each one of them on my main domain in cpanel. (This is also called creating a domain "alias", so the domains all arrive at the same home page as the main website/domain of my hosting account.)
Then as I created each site, I put a parked domain name (i.e. http://site1.com) into the Domain Modifier field.
Comment #23
monsoon commented@colorado
Thanks for your comment #22.
I solved the issue too. :)