this question has been asked of subdomains/subsites but my requirements are somewhat ’interesting’...
is there a way to have a single install of MODx, one database, a bunch of content assigned to one-or-more categories, multiple domain names (running on the same server, same filesystem), and then have MODx filter the content per domain by those categories.
what i mean is this -- let’s say i have domain1.com domain2.com domain3.com and categories (not publicly visible, just in the content manager itself) ’site1’ ’site2’ ’site3’.
and let’s also say i’ve got 3 published articles ’article1’ ’article2’ and ’article3’.
_ i assign ’article1’ to the ’site1’ and ’site2’ categories.
_ i assign ’article2’ to just the ’site2’ category.
_ i assign ’article3’ to the ’site2’ and ’site3’ categories.
when i visit domain1.com, i see article1.
when i visit domain2.com, i see article1, article2 and article3.
when i visit domain3.com, i see article3.
essentially i need to have a ’master’ site where i manage all content for MODx,
and then multiple domains to which items can be selectively published (one to many).
also each domain would need to have it’s own look and feel
(but functionally all domains would be utterly similar).
-
MODX Staff
- 10,725 Posts
Not currently, but multi-domain support with a single database (or even separate databases per domain), from a single core installation, will be possible in MODx 0.9.7 using the new Context features that are being developed and tested as we speak.
sweeet.
yeah i saw mention of Context’s in other posts and was hoping my desired effect would be possible with them.
guess i’ll have to wait with baited breath for now ;-)
I’ll bet that you could make this work with the current version of MODx and a little ingenuity. For example, use a plugin (something like the subsites/subdomains plugin) to forward to a subfolder of your installation based on the domain name in the URL. Then in each subfolder just use Ditto to index content with site1, site2, and/or site3 values in a TV. The only trick that I can see here is that you want to use different "looks" for each site. If by that you mean changing templates, then you’ll need to either switch the template using a plugin (beware: the Template Switcher plugin causes major havoc in 0.9.5, although it may now work properly in 0.9.6 but this hasn’t been properly tested) or just change the CSS file (a la CSS Zen Garden) using a TV or simple snippet. This in itself wouldn’t stop someone from manually entering a URL that shouldn’t exist (an article that should only be visible from a different domain name), so if that’s an issue you might also need to create web groups and set them automatically in the plugin as well. It’s a little bit convoluted, but I think that all of the necessary pieces are in place if you really want to do it.
pardon my ignorance... TV is something to do with taxonomy/classification?
(i come to modx by way of drupal insofar as drupal failed to meet any of my expectations;
and even five minutes into the intro to modx i’m quite intruiged...
this alone says volumes:
"alternative to hacking blogging tools and other tools to death, extended learning curves, and changing your workflow to fit software that just doesn’t quite "get it")
TV =
Template Variable
In their most basic form, these are just extra fields that you can add to any document (grouped by template, hence their name). You can use these in your output just like [*pagetitle*], [*content*], etc. But they can also have scripted input and output and do a lot more fancy tricks as well (check the link above for more documentation).
Ditto is a snippet that pulls specified content from multiple pages and outputs them as a list, site map, etc., and it can grab pages based on values in TVs and return a list with just what you want to show.
If I read this discussion it seems to me that we urgently need a filter function in AjaxSearch. Otherwise we can build multi-domain/subdomain sites but have problems with search function (because it searches all the pages over all domains/subdomains). Or not?
I think you’re right about AjaxSearch returning all pages marked Searchable (although I believe it now does check whether you have the right web group permissions to view a page before displaying it, so if you set a web group automatically based on the domain name used that should make it work properly for the situation I was describing anyway). That seems like a good suggestion to make in the AjaxSearch forum. I’ll bet you could just swipe the parent folder code from Ditto and use it in AjaxSearch with very little modification, too.
is it possible for a content node to belong to one or More groups?