different theme in one website - database

Assume this is my site name : www.example.com.
I saw different websites have different themes in a site. For example I want to have different themes for www.example.com and www.example.com/othertheme. I know it should have different database for that. But how?

I should make a directory to the root of the server which named for example othertheme which has another database. then I can go to that website with this url : www.example.com/othertheme. So it has different theme in one website.

Related

Is it possible to share 2SXC Content modules between portals on the same DNN instance?

2sxc 11.x / DNN 9.x
I have a DNN instance with a portal with lots of Content modules with different Content Types and Templates. I'm going to be making a second portal that is related to the first portal and there is some shared content. Is it possible to allow the first portal to share it's 2SXC content types and templates with the second, new portal? If so, how?
There are a LOT of ways to do this, and unfortunately there is no good guidance document 😟.
Your scenario sounds like what you would need Ghost-types for: one app creates the real type, the other app just has a ghost-reference for the original type. This is a common way to solve this - and yes, it's a very well kept secret 😉.
But I went ahead and created a checklist, just for you 🚀 https://azing.org/2sxc/r/Pj4GMYY5

Access base URL of main site in another site in Drupal 7

I have setup multisite in Drupal 7 and need to access theme settings and base url (test.com) of a main site in test1.test.com. How Can I do this one?
For example:
Main site: test.com<br>
Multisite: test1.test.com<br>
Multisite: test2.test.com <br>
likewise.
Folder structure:
sites/all/themes/testtheme/<br>
sites/test1/themes/custom_theme/test1<br>
sites/test2/themes/custom_theme/test2<br>
Thank you in advance.
I assume you should be using a different settings.php with a different DB for each sub-domain site, and in this case you can't access the variables of other sites into another site. However, there are two ways to get the main site base_url in other sites.
First, you could add a configurations variable through settings.php like $conf['main_site_base_url'] in individual settings.php OR the other way, if you are using a shared codebase, you can set this variable in custom module hook_init() or hook_boot() [whichever works with your setup] with this variable_get('main_site_base_url','test.com').
Once the confiuration variable set into the system you could get this using the variable_get function like variable_get('main_site_base_url','').
For inheriting the theme settings I would suggest to go with a sub-theme option as explained in this post.

get 2sxc app data from different portal DNN

We are setting up different sites as portals in DNN. Some content will be shared across the different portals.
I'm using the following method to render 2sxc data in a page
http://2sxc.org/en/blog/post/using-2sxc-in-webforms-custom-webapi-or-other-razor-hosts-300
However, now i want get the same data in another page of a different portal.
Can any one help with the code so i just put in the source portal id and it can be rendered in a different portal?
Yes, this can be done :)
There's an App Data DataSource, where you can specifiy the portal and app-id (in 2sxc 8.5+). Use this in a visual query or in your code.
http://2sxc.org/en/Docs-Manuals/Feature/feature/9266

Cakephp multiple applications in root folder

I have two apps and I want to access the first app by http://localhost/ (Note: no app1 folder specified here) and the second by http://localhost/app2/. How can I set this up?
why not working with virtual hosts?
thats the right way to do it:
http://www.dereuromark.de/2011/05/29/working-with-domains-locally/
you can have as many "vhosts" as you want. this will also enable you to work locally as you would live (on the webserver).

How do I name a drupal page template file according to a node's url path setting?

I'm new to drupal and having trouble naming a page template file. In drupal 7, let's say I've created a basic page with the url path as:
www.example.com/my-page
When I create a custom page template file, I've been able to get the file name page--node--[nid].tpl.php to work fine. However, I have 3 different sites (localhost, development, and production) and each has a different node id for this page (because the databases aren't sync'd). I need to find a way to name the template file according to the url path. I've tried all of the following, none of which has worked:
page--my-page.tpl.php
page--my_page.tpl.php
page--node--my-page.tpl.php
page--node--my_page.tpl.php
Any suggestions?
Check out the theme developer module. With it you should be able to get a list of possible template names that are being considered.

Resources