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.

New to MSM - Can someone explain some basics please

October 22, 2012 7:55pm

Subscribe [2]
  • #1 / Oct 22, 2012 7:55pm

    koala kid

    72 posts

    I’ve been using EE for some time but this is the first site using Multi Site Manager and I’d appreciate some answers and direction.

    First off I’m using MSM to manage sub-domains, not sure if that makes a difference. The sub-domains will look and behave very similar to the parent site and so will often use the same templates and display some of the same entries.

    1. Assets - I keep CSS and JS files in their respective directories in the root of the parent site. Obviously I want to re-use the same assets, what is the best way to do this. Can I use the {embed} tag and specify the parent site as a parameter? Or is there a config setting where I can specify where to load assets?

    2. Images - I keep non EE controlled images in an img folder in the root. Again what is the best way to include these in my sub-domains? Let’s take for example a main navigation image, what’s the best way to reference that from a sub-domain?

    3. Images controlled via EE - again I will be re-using many images uploaded in the parent site directory in the sub-domains. How to I make sure these are referenced correctly? Is this simply by specifying the full URL in the image upload directory?

    4. SSL certificate - some sections of the site will be using SSL. If I am importing content from the parent domain into a sub-domain how do I avoid the “insecure content” issue?

    Anything else I’ve missed or you think I should know please shout!

    Thanks.

  • #2 / Oct 24, 2012 9:48am

    Dan Decker

    7338 posts

    Hi koala kid,

    Thanks for your questions on using MSM!

    1. Assets - I keep CSS and JS files in their respective directories in the root of the parent site. Obviously I want to re-use the same assets, what is the best way to do this. Can I use the {embed} tag and specify the parent site as a parameter? Or is there a config setting where I can specify where to load assets?

    If you are keeping them as flat files at the root directory of your website, you simply reference them through the main domain. Are you keeping them as templates in EE or as files? Just want to make sure the expectation is clear.

    2. Images - I keep non EE controlled images in an img folder in the root. Again what is the best way to include these in my sub-domains? Let’s take for example a main navigation image, what’s the best way to reference that from a sub-domain?

    Same as above.

    One way you can ease the administration of this would be to create a few Global Variables that have the original site’s URL:

    {main_site}
    <a href="http://www.main-domain.com/path/to/assets/">http://www.main-domain.com/path/to/assets/</a>

    3. Images controlled via EE - again I will be re-using many images uploaded in the parent site directory in the sub-domains. How to I make sure these are referenced correctly? Is this simply by specifying the full URL in the image upload directory?

    MSM allows you to copy upload destinations when creating a new site. This is likely the trickiest part. The duplication should pull the original paths, and URLs, which would make it easy.

    4. SSL certificate - some sections of the site will be using SSL. If I am importing content from the parent domain into a sub-domain how do I avoid the “insecure content” issue?

    Ok, this will be the tricky part 😉 Pulling assets cross-domain may prove onerous. The best way to address this is probably through .htaccess and judicious use of Global Variables.

    Anything else I’ve missed or you think I should know please shout!

    Get started testing as soon as possible. MSM makes running multiple sites really easy, once set up. However, I see most people frustrated due to a lack of careful planning and the assumption that it will be a flawless experience. Give yourself plenty of wiggle worm to overcome obstacles.

    Let me know if you have any other questions!

    Cheers,

  • #3 / Oct 24, 2012 2:06pm

    koala kid

    72 posts

    Hi Dan,

    thanks for your responses. This is the way I’m going to tackle it I believe.

    1. Create a template in the parent site that will include all the references to the js, css files. I will either hard code the parent site full URL or create a variable as you suggest. I will then embed this template in the local sites using {embed=default_site:head}. Sound sensible?

    2. Static images - use the global variable approach as above.

    3. EE controlled images - within the upload preferences page I will set the URL path to include the full parent domain URL. This will make sure images are available to sub-domains without having to make duplicates of images.

    4. SSL - If images are required cross domain I will update the upload preferences to use https instead of http. This should hopefully fix that issue, not sure if it will create others though.

  • #4 / Oct 25, 2012 3:17pm

    Dan Decker

    7338 posts

    3. EE controlled images - within the upload preferences page I will set the URL path to include the full parent domain URL. This will make sure images are available to sub-domains without having to make duplicates of images.

    That will work, once this bug fix is applied.

    Every thing else looks like you have a solid plan!

    Is there anything else I can assist you with?

    Cheers,

  • #5 / Nov 09, 2012 2:30am

    koala kid

    72 posts

    Hi Dan,

    I finally installed MSM today and set up my first local site but I’m having a few issues.

    Initially I was getting some database errors but I tracked down a bug report, applied the fix and managed to create the new site.

    However I’m not seeing what I thought I would when playing with the templates. I’ve duplicated many of the same channels, preferences and templates.

    First off I’ve updated inc/head on siteA to have absolute paths to css files e.g.

    <link media="all" rel="stylesheet" type="text/css" href="http://www.example.com/css/boilerplate.css">

    In one of the SiteB templates I’ve modified the embed tag to pull from site A e.g.

    {embed="default_site:inc/head"}

    However checking the source I am still seeing :

    <link media="all" rel="stylesheet" type="text/css" href="/css/boilerplate.css">

    So then I went into inc/head on SiteB and updated the path there with some random stuff just to see if it was pulling in that file but checking the source there has been no change in the paths. I’m using text files for templates so I’ve checked the database version but that is showing the change in path.

    So I’m confused. I’m not sure where this template is being pulled from.

    I’m also seeing “field_id_89” instead of the data / copy that should be displayed in the template.

    Has there been an error when creating the new site or am I missing something basic?

    Thanks.

  • #6 / Nov 09, 2012 1:53pm

    koala kid

    72 posts

    Quick update.

    I took a look at the entries in the new site and instead of the having the actual data in the field it looks like the reference got passed, i.e. field_id_30.

    Also I’m using the pages module and the entries got copied over but not the pages data, ie the template or URL path. Is this standard behavior?

    Thanks.

  • #7 / Nov 12, 2012 12:48pm

    Shane Eckert

    7174 posts

    Just noting that question was asked here as well.

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

ExpressionEngine News!

#eecms, #events, #releases