如果网站有两个同名页面,如何获取页面列表?

发布于 2024-08-23 06:25:14 字数 356 浏览 5 评论 0原文

例如

http://www.sitename.com/section1/pagename。 aspx

http://www.sitename.com/section2/pagename.aspx

我需要仅针对具有相同名称的页面的快速报告。就像示例中的“pagename.html”一样。

for example

http://www.sitename.com/section1/pagename.aspx

http://www.sitename.com/section2/pagename.aspx

I need quick report only for pages which has same name. like "pagename.html" in example.

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

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

发布评论

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

评论(5

爱给你人给你 2024-08-30 06:25:14

抓取您的网站,反转找到的 URL 并排序?

crawl your site, reverse the found URLs and sort?

感性 2024-08-30 06:25:14

如果这是一个 Sitecore 网站,正如我所相信的那样,您是否可以直接进入内容编辑器并搜索您要查找的名称?例如,任何项目名称为“pagename”的内容在标准 Sitecore 安装中都会有一个以“pagename.aspx”结尾的 URL。只需确保您查看的是实际的项目名称而不是显示名称,因为它们有时可能会完全不同,具体取决于您设置 URL 的方式。

If this is a Sitecore site as I'm led to believe, could you not just go into the Content Editor and search for the name you're looking for? Anything with the item name of "pagename", for example, will have a URL ending with "pagename.aspx" in your standard Sitecore install. Just make sure you're looking at the actual item name and not the display name, as they can be quite different at times depending on how you've got the URL's set up.

你如我软肋 2024-08-30 06:25:14

我会编写一个快速实用程序,以编程方式遍历内容树,将名称保存到字典中......当您点击字典中已有的项目时,就会发生名称冲突。

I would write a quick utility program to just traverse the content tree programmatically, saving the names to a dictionary... when you hit an item that is already in the dictionary, you've got a name collision.

淡紫姑娘! 2024-08-30 06:25:14

编写一个过滤器(我认为这就是它的名称)

您可能考虑的一件事是为此http://trac .sitecore.net/AdvancedSystemReporter

这将允许您在 Sitecore 中拥有一个很好的界面来查看重复的项目名称。

One thing you might consider is writing a filter (I think that is what it is called) for this

http://trac.sitecore.net/AdvancedSystemReporter

That would allow you to have a nice interface in Sitecore for viewing duplicate item names.

铜锣湾横着走 2024-08-30 06:25:14

您的数据库有多大,您的 LINQ to Objects 怎么样?理论上,您可以针对 Database.Items 编写 LINQ 查询,以查找来自内容树的同一站点分支的具有相同名称的项目。如果您的主数据库很大,这可能会占用大量内存,但编码并不困难。

编辑 - 如果您可以循环所有网站项目,您可以执行以下操作(未经测试):

        var items = siteItem.Axes.GetDescendants();
        var dupes = from item in items
                    join item2 in items on item.Name equals item2.Name
                    where item.ID != item2.ID
                    select item;

How big is your database, and how is your LINQ to Objects? Theoretically you could write a LINQ query against Database.Items that looks for items with the same name that descend from the same site branch of your content tree. This could be very memory intensive if your master DB is large, but would not be difficult to code.

Edit -- if you can loop over all your site items, you could do something like this (untested):

        var items = siteItem.Axes.GetDescendants();
        var dupes = from item in items
                    join item2 in items on item.Name equals item2.Name
                    where item.ID != item2.ID
                    select item;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文