如果网站有两个同名页面,如何获取页面列表?
例如
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
抓取您的网站,反转找到的 URL 并排序?
crawl your site, reverse the found URLs and sort?
如果这是一个 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.
我会编写一个快速实用程序,以编程方式遍历内容树,将名称保存到字典中......当您点击字典中已有的项目时,就会发生名称冲突。
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.
编写一个过滤器(我认为这就是它的名称)
您可能考虑的一件事是为此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.
您的数据库有多大,您的 LINQ to Objects 怎么样?理论上,您可以针对 Database.Items 编写 LINQ 查询,以查找来自内容树的同一站点分支的具有相同名称的项目。如果您的主数据库很大,这可能会占用大量内存,但编码并不困难。
编辑 - 如果您可以循环所有网站项目,您可以执行以下操作(未经测试):
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):