2015-12-08 25 views
0

客户想要将他们使用Adobe Catalyst制作的网站移动到不同的托管服务提供商。我能够通过FTP复制整个网站并将其移至新主机。一切看起来很好,除了许多链接留下代码,看起来像这样:当迁移催化剂网站离开模块代码

{module_contentholder, name="_U309"} {module_contentholder, name="_U299"} 

有人知道这是什么或如何解决它?

回答

2

这些是对Content Holders.的引用它们的工作与PHP的include语句类似,但它们引用的文件固定为单一路径:/_System/ContentHolders/

您可能会遇到更多此类标签,例如{module_menu}{tag_pagecontent}。您需要手动调整它们以适应新主机的使用。该文件将帮助:http://docs.businesscatalyst.com/reference/


在你的例子所示的内容持有人的姓名钝表示网站很可能已被Adobe Muse, WYSIWYG编辑器生成的。我强烈建议您找到原始.muse项目文件,并使用它们来更新该网站。 Muse can compile the site for platforms other than Business Catalyst.

0

通过研究,我发现没有办法让这些代码正确显示而无需单独编辑每个页面。幸运的是,我编写了一个PHP脚本,通过每个页面的代码并自动替换它。

步骤1:在一个名为replacement.php

步骤2索引目录中的文件:将这个代码

$file = $_GET['file']; 
$path = '/path/to/public_html/' . $file; 
$file_contents = file_get_contents($path); 
preg_match_all("/{module(.*?)}/", $file_contents, $matches); 
foreach($matches[0] as $match) { 
    if(preg_match('/\"([^\"]*?)\"/', $match, $query)) { 
     $queryNew = str_replace("\"", "", $query[0]); 
     $queryPath = '/path/to/public_html/_System/ContentHolders/' . strtolower($queryNew) . '.html'; 
     $queryContents = file_get_contents($queryPath); 
     $file_contents = str_replace($match, $queryContents, $file_contents); 
    } 
} 

file_put_contents($path, $file_contents); 

步骤3:更换它说:/路径/到/的public_html /到您的域名文件位置。

第4步:转到http://www.yourdomain.com/replacement.php?file=index.html以更改索引文件。您可以将url中的“index.html”更改为您要转换的任何其他页面。

希望这可以帮助别人在未来。