0

我目前正在使用 7.1 update 2 使用 Web 表单运行多个站点。我正在创建一个新站点并想使用 MVC 但无法使其正常工作;但是,我可以获得默认的“网站”来使用 MVC,但不能使用自定义网站。

例如,假设我有两个站点,site1 和 site2,site1 是 Web 表单并且工作正常,我如何定义 MVC 的“site2”?不确定“physicalFolder”属性中的值应该是什么。或者该站点应该在其他地方定义。

谢谢

<site name="site1"
  targetHostName="site1.com"
  hostName="site1.com"
  virtualFolder="/"
  physicalFolder="/site1"
  rootPath="/sitecore/content/site1"
  startItem="/Home"
  language="en"
  database="master"
  domain="extranet"
  allowDebug="true"
  enablePreview="true"
  enableWebEdit="true"
  enableDebugger="true"
  enableWorkflow="true"
  patch:before="site[@name='website']" />
4

1 回答 1

1

physicalFolder 参数将允许您指定 Sitecore 查找指定站点所需的任何物理文件的物理路径。它是可用于组织多站点实例的物理文件的选项之一。

您将在 web.config 注释中看到以下定义:

    physicalFolder: The physical location of files for the site.
                    If the site is based on physical files, this is the path to the folder holding the files.
                    For non-physical sites, this is the place where Sitecore looks for a default.aspx file (to start the pipelines).

您可以在此处找到有关physicalFolder 参数的更多信息-> http://sdn.sitecore.net/Articles/Administration/Configuring%20Multiple%20Sites/Adding%20New%20Site/site%20Attribute%20Properties/physicalFolder.aspx

至于配置您的 MVC 站点,就站点定义而言,您确实不需要做任何特别的事情。您应该能够复制您的 Site1 定义并进行适当的更新。Sitecore 将根据您页面上定义的布局和子布局使用正确的呈现方法。

<site name="site2"
 targetHostName="site2.com"
 hostName="site2.com"
 virtualFolder="/"
 physicalFolder="/site2"
 rootPath="/sitecore/content/site2"
 startItem="/Home"
 language="en"
 database="master"
 domain="extranet"
 allowDebug="true"
 enablePreview="true"
 enableWebEdit="true"
 enableDebugger="true"
 enableWorkflow="true"
 patch:before="site[@name='website']" />
于 2014-06-02T14:40:31.087 回答