ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MSM Save Files as Templates

October 27, 2011 2:24pm

Subscribe [3]
  • #1 / Oct 27, 2011 2:24pm

    Chris Arnold

    201 posts

    I’m a bit confused about an MSM expansion I just made as it relates to my templates saved as files. I’ve been building the default_site for a few months now and duplicated the efforts to site_2 this morning. I’m pointing the URL to a subdomain and the control panel access to the default_site for ease of use. I then noticed the site files (both sites) were suddenly not updating when saving from my local copies.

    Beforehand, I did duplicate the templates folder for site_2 and updated the Basepath to Template File Directory in the control panel for both. Basically the folder structure and paths are:

    ... expressionengine/templates/default_site
    ... expressionengine/templates/site_2

    I thankfully have both copies of the correct template code locally, but uploading them to these folders shows no change in what’s being displayed on each site—even though the files on the server are also correct. Currently the template in the control panel appear to be pulling some old code from the database, or are blank, instead of these files.

    version 2.3.1
    build 20111017

  • #2 / Oct 27, 2011 2:41pm

    Chris Arnold

    201 posts

    Actually, the one thing I didin’t try was just attempting the relative path to the /templates folder. This appears to be working. So for both sites, using the path below, although there are 2 site folders inside. Can you confirm this is correct? Scratching my head as to how EE “knows” which is which. Matches the site_name?

    ... expressionengine/templates/
    ... expressionengine/templates/
  • #3 / Oct 27, 2011 3:34pm

    Chris Arnold

    201 posts

    On the topic of MSM, is there a best practice when the hosting is in one place, and the domains are being controlled elsewhere? e.g. Making sure domain1 points to default_site and domain2 points to site_2.

    Site 1, which is currently on the root at the host, to go to site1.com
    Site 2, which is currently a subdomain of the root at the host, go to site2.com

  • #4 / Oct 28, 2011 1:25am

    John Henry Donovan

    12339 posts

    Hi Chris,

    Actually, the one thing I didin’t try was just attempting the relative path to the /templates folder.

    Did you start off using full server paths?

  • #5 / Oct 28, 2011 11:20am

    Chris Arnold

    201 posts

    Hi Chris,

    Actually, the one thing I didin’t try was just attempting the relative path to the /templates folder.

    Did you start off using full server paths?

    No, I pointed each site to its own folder within /templates as noted above, instead of simply /templates for both.

  • #6 / Oct 29, 2011 5:23pm

    Dan Decker

    7338 posts

    Chris Arnold,

    ExpressionEngine only needs the know the “root” to your templates directory. From there, it will make a folder for each site in MSM; default_site, site_2, site_3, etc. Inside each site’s respective directory EE will create “group” folders for each of your template groups in the form of template.group. So each of your MSM sites only needs to know the “base” path to the template folder. Does that help clear things up?

    Cheers,

  • #7 / Oct 31, 2011 11:41am

    Chris Arnold

    201 posts

    It does make sense (now). I’ll point out that EE doesn’t (or didn’t for me) auto-create the grouped folder for the new MSM site. This is something I did manually and copied the previous files over to it. See the Saved Templates and the Multiple Site Manager section in the Templates guide.

    As for my other question,

    On the topic of MSM, is there a best practice when the hosting is in one place, and the domains are being controlled elsewhere? e.g. Making sure domain1 points to default_site and domain2 points to site_2.

    Site 1, which is currently on the root at the host, to go to site1.com
    Site 2, which is currently a subdomain of the root at the host, go to site2.com

    Is there a go to resource for double checking we set this up correctly?

  • #8 / Nov 02, 2011 10:04pm

    Dan Decker

    7338 posts

    Chris Arnold,
    There is the section on sub-folders and sub-domains in the User Guide.

    The key things to note are that each site needs to have path access to your main site’s system folder and that each site’s index.php and admin.php have

    $system_path = './system';

    set properly.

    Is there anything else we can assist you with?

    Cheers,

  • #9 / Nov 03, 2011 11:14am

    Chris Arnold

    201 posts

    Perhaps I didin’t phrase my question correctly. When working with the domain names themselves, e.g. Bob.com and Tom.com, how does EE know that Bob.com is site_1 and Tom.com is site_2? I haven’t pointed two separate domains to one EE build in the past (rather, built MSM with subfolders and the same domain), so that’s my question. I don’t think that user guide document (or anything in the MSM docs) talks to that specifically unless I missed it.

  • #10 / Nov 04, 2011 1:03pm

    Robin Sowell

    13255 posts

    Ah- basically it’s the index.php page- where you’ve specified the site short name (along with a few other things).  As long as it has the short name, it has the site id.  It doesn’t really care about the domain name- but will use it properly in variables and such as long as your urls/paths are correct for that site’s config settings.

    That help at all?  So if your second domain is created by pointing to a subfolder- in that subfolder is an index.php with the short name for the ‘Tom’ site.  Anything served up via that index.php file is going to use the settings for site_id 2 (or whatever is associated w/the shortname in that index.php file).

    That help clarify?

  • #11 / Nov 04, 2011 3:30pm

    Chris Arnold

    201 posts

    Yeah, it does. I kind of figured EE had the smart-awareness like that but not having done it before, was worth an ask. Thanks!

  • #12 / Nov 04, 2011 5:38pm

    Robin Sowell

    13255 posts

    Always good to ask w/MSM- it can get a bit confusing!  Glad that clarified, and if you run into anything else, just let us know!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases