Drupal 7 Change of View depending on domain - database

Is it possible in drupal 7 (and any other drupal versions) to have a SHARED DATABASE for 2 sites and the views would change depending on the subdomain / the URL.
Please see the illustration below.
All I want is to have a shared database for multiple site but with multiple view depending on the sub / domain it is accessed and modules / themes scope such as Captcha module should only be visible in the site2.
I'm stuck with this part. My second option is to have 2 database but only 1 database for accessing my site-specific data but for the segregation of content management data I think it would be best if I would have separate database as well for controlling access for modules. Let me know your thoughts.
Thanks in advance.

Yes. Drupal DB abstraction and configuration setup is flexible enough to do the scenario you are going for. You will have to deal with users, then again here too it is a question of choice as Drupal allows you to share users or have different userland for each site. There is a book out there on this subject, and many sites to assist in the various multi-site scenario options.
By the way, you can always post your D questions in drupal.stackexchange.

This is easily solved with Panels as you can just choose the right Views view from there.
There is no reason not to use panels on any drupal site imo.

Related

Two wordpress installs on same domain how to share database?

I have 2 wordpress installs on one domain what I want to do is have both installs update posts as I add a post to the main install, how can I do this?
I believe it may be possible to have 2 front facing domains use the same database (share posts) but you will need to make the options parts different tables since they will use different themes/plugins I presume. Take a look at this page they seem to be on the right path. https://wordpress.org/support/topic/2-sites-1-db-possible?replies=15
You are facing a few problems.
First of all, wordpress saves domain names in the database. Also, in posts itself, when you add an image for example, the domain where you are on will be used in that post.
And as what you are doing is highly unusual, third party plugin builders don't take this situation into account, so any new plugin could break your setup in unexpected ways.
Another possible problem, but maybe not really one that concerns you is duplicate content. You'll get two exactly the same articles on two domains, without a canonical url.
Basically I would advise against this. There just are too many unknowns. Maybe a better approach is to investigate how to use WP multisite in this situation, and share content between the sites (this could do the trick), or use an alternative like ManageWP

Drupal 7 multi-site, multiple database and 1 shared code base

I want to develop drupal multi-site with this structure:
One shared codebase drupal 7 multi-site, each web site has own database.
One master web site that has some tables shared.
Each multi site instances read some tables from master's database, not own database. For example conntent types, fields, views, rules and related configirations read only master's database. So I can develop all sites on one place.
As a result each site must use same content types, views, rules but different contents. I am user 1 of all sites. Sub site editors has create content and user permisions only. I dont want to share users accross sites. So I cant use domain acceess. Is it possible that?
Thanks for your helps.
This module should allow you to accomplish what you are looking for:
https://drupal.org/project/domain
As it states in the module description you can share tables with the domain prefix module. You can select which tables will be shared and which ones will not.

Drupal 7 Views and custom Modules?

I have implemented several custom modules which essentially bridge Drupal with some third party applications we build in house.
Now as my knowledge of Drupal grows I am curious to know whether or not it is possible to integrate my modules with Drupal VIEWS for reporting purposes.
My modules connect directly to several MySQL databases on an external server and perform queries and render those results within the context of Drupal.
What I would like to do, is use VIEWS somehow to SELECT and manipulate the query as a Drupal VIEW to avoid having to re-purpose the module queries each time a change is requested.
Basically, is it possible to expose the SQL tables in an external app to one which Drupal VIEWS can pick up? I have googled and found a few suggestions but no one seems to know for sure???
It seems drupal expects all content to be of it's own internal "content type" and thus connected to it's core "node" - is this an assumption VIEWS makes?
I don't want to export my third party data into Drupal "nodes, content types, etc" simply so VIEWS can effectively read and render the results.
Seems to me, this should be possible with a Drupal module bridging the gap somehow???
Cheers,
Alex
You could use data module http://drupal.org/project/data
It gives you option to use views on your custom tables. I hope this helps you.

Multiple Updates in Drupal

I want:
1. To be able to update multiple sites with one upload
2. News page will now database driven
3. Updates in common elements likes LOGOS, COUNTRIES, ADDRESSES, TELEPHONES, FAX NUMBER and EMAIL ADDRESSES can be done with limited HTML knowledge
Hello guys..Is this possible in Drupal 7?
Thanks
It is possible.
But you might need to search for right module or write your own. You might need install the features module or the domain access. But what you are asking is quite general question, with Drupal everything is possible. But you might need to write PHP code for matching your special needs.

Best way to be done? Subdomains and MySQL

I'm asking your opinions about my next project..
I'm planning to make website which offers services where all users would be have own subdomain (user.mydomain.com) and own website.
First I was thinking to really make real subdomain, generating automatically website code into their folder, creating own database etc..
Question #1: When I need some information from all subdomains databases in my main page (mydomain.com), how can I fetch those?
Would it be better way just use one database and dynamic code what all users are using but then re-write address like it would be subdomain (mydomain.com?user=myuser -> myuser.mydomain.com)
If someone have experience with something like what I was planning, would be nice to have tips and tricks do it right! :)
Thanks!
It will be alot of less code to maintain in you have one common codebase for all users, that just reads the domain name and uses that information.
Imagine that you discover an error in the code that was generated for one of the subdomains.
Either you would have one place to correct, or you would have 1 place + the number of users to correct.
You'll probably want all of the subdomains to point to the same codebase and treat the subdomain as an argument that is pulled out and identifies which instance of this application it is. You'll need a table in your db that will store information about each instance and then user accounts, user data, etc will all be tied back to a specific instance.

Resources