如何获取 DotNetNuke 中的所有公共页面?
我是 DNN 网站的新手,希望在我的皮肤顶部显示根级页面(主页、联系我们等)的列表。现在我有:
TabController.GetPortalTabs(0,-1, false, "", false, false, false, true,false);
为显示链接的中继器供电。然而,当我登录编辑页面时,导航会增长到包括所有管理级别页面,这破坏了我的设计。有没有办法即使我登录后也只显示公共页面?
I am new to DNN web sites, and would like to display a list of the root level pages (Home, Contact Us, etc..) at the top of my skin. Right now I have:
TabController.GetPortalTabs(0,-1, false, "", false, false, false, true,false);
Feeding my repeater which displays the links. However, when I am logged in to edit the pages, the navigation grows to include all admin level pages as well and breaks my design. Is there a way to get just the public pages to show even when I am logged in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 var tabs = TabController.GetTabsByParent(-1, PortalId);
然后,您可以过滤该选项卡列表以删除菜单中未显示的任何选项卡。像下面这样的东西。
You could use var tabs = TabController.GetTabsByParent(-1, PortalId);
Then you could filter through that list of tabs to remove any that aren't displayed in the menu. Something like the following.
Linq 的一点点制作是干净整洁的
A little bit of Linq makes is nice and clean
我还必须检查该页面是否已删除或者我是否出现了僵尸页面。
I had to also check if the page was deleted or I was getting zombie pages to show up.
使用上面的帮助到达这里:
Used the help from above to get here: