Sitecore 全局 url 到特定 url

发布于 2024-12-07 07:16:52 字数 528 浏览 0 评论 0 原文

目前我面临以下问题:

我必须为一家公司制作一个网站,该网站位于不同的位置。但一些页面的内容对于所有位置都是相同的。现在我已经创建了一个全局文件夹,其中包含所有位置的项目。但现在我面临以下问题:当从特定位置的网站访问全局项目时,我得到全局 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

も让我眼熟你 2024-12-14 07:16:52

Adam Weber 是对的,克隆是您最好的解决方案:

  1. 创建您的全局部分,其中包含您需要的所有子项
  2. 对于每个本地部分,克隆全局部分并将其放置在您希望它出现在本地菜单中的位置

Adam Weber was right, cloning is your best solution:

  1. Create your Global section, with all the child items you need
  2. For each of your local sections, clone the global section and place it where you'd like it to appear within your local menu
魔法少女 2024-12-14 07:16:52

如果我理解正确的话,这就是我会做的。这可能不是最漂亮的解决方案。但它会起作用的。

您的“数据”项目位于 /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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文