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 template files synchronization

August 03, 2011 9:44am

Subscribe [3]
  • #1 / Aug 03, 2011 9:44am

    James Smith

    259 posts

    I’m trying to embed a template from another MSM site, however it only seems to pull the template from the database instead of from the template file. I can workaround this by going to the CP template and saving it so that it gets updated in the database, but this is quite tedious. Am I missing something obvious here/is this how it’s supposed to work?

    It doesn’t help that I have a relatively complex setup with each MSM site also having a separate development site, and template locations split between dev and live folders tied together with Subversion and workflows that launch templates live with an SVN commit… it all works very nicely except for this problem. Fortunately I’m only using a single database though, which does simplify things a lot.

    In order to achieve this setup I’m also overriding the tmpl_file_basepath setting per-site in the path.php file ( http://expressionengine.com/wiki/Per_Site_Config/ ) - not sure if that could affect things.

    EE 1.7.0 Build: 20101018 + MSM 1.1 Build: 20100805

  • #2 / Aug 04, 2011 1:29am

    John Henry Donovan

    12339 posts

    At the Gates,

    Ok it looks like you have a pretty complicated set-up.

    So can you start by commenting out that tmpl_file_basepath override and see if issue persists.
    We can then at least rule that out if it doesn’t.

    To confirm. Are you using the following syntax for your embed?

    {embed="site_short_name:template_group/template"}
  • #3 / Aug 04, 2011 9:55am

    James Smith

    259 posts

    Hi John, thanks for your reply,

    Commenting out that override fixes the issue (but I’m reliant on that override for my dev->live workflow). Are there any other methods of having two different template locations per MSM site? It’s a shame because it really is working beautifully for the main site (in fact it’s working well for all the MSM sites, just not when I want to share templates between them).

    James

  • #4 / Aug 04, 2011 11:39am

    James Smith

    259 posts

    Ok, I think I’ve got this fixed now.

    Instead of overriding each site in its individual path.php file I’m doing a switch/case statement in the live config.php file to set tmpl_file_basepath dynamically based on $_SERVER[‘HTTP_HOST’].

    Seems to work.

    Thanks

    James

  • #5 / Aug 05, 2011 12:48pm

    Kevin Smith

    4784 posts

    Glad you found a solution, and thanks for posting it back here for us, James! Closing this one out…

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

ExpressionEngine News!

#eecms, #events, #releases