Micro Site / Sub Folder Multi Site

azraai - 2 months ago

I have a project requirement to have multiple site on subfolder. An example

  1. Main Site - http://example.com
  2. Campaign A - http://example.com/a
  3. Campaign B - http://example.com/b

I have take a look at the Multi Site module. It seems it doesn't fit to my requirement.

I'm looking to create a new Site module to handle microsite requirement and add additional "organization" field to user table to restrict the access to the microsite to selected users.

Has anyone tried this before and successfully implemented in any PyroCMS installation before?

ryanthompson - 2 months ago

Do these "sites" really need separation? Ie different users and database tables?

Personally I would look into using different themes in a page structure with a custom page handler. If the sites are small enough (seeing campaign there - is it a single page).

Otherwise you technically need different domains / sub domains for sites. You could use separate installations but that kinda defeats the purpose perhaps?

If you like, share a little more details about the project and we can better guide you ^_^

azraai - 2 months ago

Hi Ryan, Thanks for replying. Having "sites" seperation currently is not in my consideration since I need to pull some content from the microsites into the main site.

The sitemap looks something like this: https://www.dropbox.com/s/vwtsdaeh9zwwt0v/Screen%20Shot%202017-05-25%20at%201.58.57%20PM.png?dl=0

One of the requirement is when an admin for "Site B" logged in to admin, he/she can only see users from "Site B".

Best Regards.

ryanthompson - 2 months ago

Ah gotcha - ok those are definitely going to be different sites/installs then. I would say this; If you are ok with it use multiple installations. Same DB if you want obviously but because of the sub-directory structure and how sites currently works, this will be your path of least resistance.

Being that you need data between them - you can use a plugin / query using a model that uses an alternate connection (which connects to the other site's tables/database) and use that to pull in content across sites.

What are your thoughts on that?