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 and Templates

August 30, 2007 1:27pm

Subscribe [2]
  • #1 / Aug 30, 2007 1:27pm

    bjsteiger

    87 posts

    I found a very interesting thing about MSM, and I don’t know if I am sharing it, reporting a bug, or something else.

    When we created our templates on the main site we always have a “inc” template group with the .header and .footer - these two files basically make up the entire design and then on each template we just embed these two files at the beginning and at the end, like so:

    {embed="inc/.header"}
    
    Content for page goes here
    
    {embed="inc/.footer"}

    Well we setup a new MSM site with a subdomain and we tried to embed and we found out a number of interesting things. Even though the number is small, it has huge implications.

    1. Variables do not transfer through sites, so if you want to have global variables they have to be defined in each MSM because even though you are embedding a template from another site, it is looking for the local site Global Variables, either that or define them each in your path.php file (but still they must match between sites).

    2. Relative Pathing - depending upon how your server is setup you really have to think through your relative pathing (this is not an EE thing, but rather a code thing). This even means how to you path elements in your CSS.

    3. Saving Templates as Files - we found out that no matter what we did to our server configuration we could not save the files unless we saved them on the primary site path (this could be a bug, but again like #2 above it depends on how your server handles subdomains). I haven’t test this, but I am thinking we may run into this similar issue on images as well.

    Note: Our server setup for domains is that each domain is independent of the primary domain for security reasons. So each subdomain has its own httpdocs directory and not pointing to a folder on the main domain (this could be part of the issues).

    #3 may be a bug so I would be interested if anyone with our similar server setup is running into these issues.

    enjoy…
    bjs

  • #2 / Aug 31, 2007 11:56am

    Derek Jones

    7561 posts

    Hey, bjs, thanks for sharing your comments.  #1 and #2 might be good candidates for a user contribution to a relevant page of the User Guide.  Absolute paths are always recommended inside ExpressionEngine since your pages are “virtual directories” and the browser, not being aware of that of course, tends to look for relatively pathed files in locations that don’t exist.

    #3 sounds like a server environment issue, most likely an open_basedir restriction that prevents domains from reading and writing to files in another domain’s account.  If you own both, most hosts have a way that you can specify your own accounts as “safe” to allow reading and writing to and from each.

  • #3 / Sep 01, 2007 2:33pm

    bjsteiger

    87 posts

    Hey Derek,

    Interesting on #3 because we already set a open_basedir restriction to work going either direction between the sites. We even set it to ‘none’ and we still had no luck.

    bjs

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

ExpressionEngine News!

#eecms, #events, #releases