目前我面临以下问题:
我必须为一家公司制作一个网站,该网站位于不同的位置。但一些页面的内容对于所有位置都是相同的。现在我已经创建了一个全局文件夹,其中包含所有位置的项目。但现在我面临以下问题:当从特定位置的网站访问全局项目时,我得到全局 url。但我想要的是特定位置url保持相同的结构,例如:
- 现在是www.url.com/global/subfolder/itemname
- 而我想要的是www.url.com/location1/subfolder/itemname
有没有人对于这个问题有任何解决方案/建议吗?
是否有人还有一个解决方案来创建一个菜单来插入这些全局项目,同时也插入特定于位置的项目?
有关我的 Sitecore 内容结构的更多信息
- Global:包含所有位置的全局项目
- Corporate:公司的企业网站
- Location1:location1 的网站
- Location2:location2 的网站
Currently I am facing the following problem:
A website, which I have to make for a company, has different locations. But the content of a few pages is for all locations the same. Now I have created a global folder with the items for all the locations. But now I am facing the following problem: when accessing the global items from the website of a specific location I get the global url. But what I want is that the specific location url remains the same structure, for example:
- Now it is www.url.com/global/subfolder/itemname
- And what I want is www.url.com/location1/subfolder/itemname
Does anybody have any solution(s)/suggestion(s) for this problem?
Does anybody also have a solution for creating a menu to insert these global items but also to insert the location specific items?
Some more information about my Sitecore content structure
- Global: contains the global items for alle locations
- Corporate: the corporate website of the company
- Location1: the website of location1
- Location2: the website of location2
发布评论
评论(2)
Adam Weber 是对的,克隆是您最好的解决方案:
Adam Weber was right, cloning is your best solution:
如果我理解正确的话,这就是我会做的。这可能不是最漂亮的解决方案。但它会起作用的。
您的“数据”项目位于 /global/subfolder/itemname 中
,然后只需创建一些模板,这些模板是“虚拟”页面,仅包含指向全局项目的链接(也许还有一些可能不同的字段(可能需要联系电子邮件) 然后你创建一个子布局
,基本上只是获取引用的项目并使用它而不是 Sitecore.Context.Item
然后在中创建“虚拟”模板的实例 。 /location1/subfolder/itemname 并将其引用到 /global/subfolder/itemname
这样您的 URL 将是正确的并且数据将是相同的
另一个可能更聪明的解决方案(如果您启用了代理)是创建一个代理。
/global/subfolder/itemname 作为源并指向 /location1/subfolder/ 作为目标(或者您可以采用 /global/subfolder 并选中“包含子文件夹”。
以下是有关如何在 5.3 中使用代理的指南:
http://sdn.sitecore .net/Articles/Administration/Using%20Proxy%20Items%20in%205,-d-,3.aspx
If I understand you correctly, this is what I'd do. It might not be the prettiest solution. But it'll work.
You have your "data" items in /global/subfolder/itemname
then just create some templates, which are "dummy" pages, that only contain a link to the global item (and perhaps the few fields that could differ (perhaps contact email for the specifik location).
Then you make a sublayout that bascially jsut gets the referenced item and uses that instead of Sitecore.Context.Item.
Then create an instance of the "dummy" template in /location1/subfolder/itemname and reference it to /global/subfolder/itemname
That way you URLs will be correct and the data will be the same.
Another and probably smarter solution (if you have enabled proxies) is to create a proxy that takes
/global/subfolder/itemname as source and points to /location1/subfolder/ as target (or you could take /global/subfolder and check "include children".
Here is a Guide on how to use proxies in 5.3:
http://sdn.sitecore.net/Articles/Administration/Using%20Proxy%20Items%20in%205,-d-,3.aspx