如何获取 DotNetNuke 中的所有公共页面?

发布于 2024-12-10 18:40:45 字数 239 浏览 0 评论 0原文

我是 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 技术交流群。

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

发布评论

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

评论(4

dawn曙光 2024-12-17 18:40:45

您可以使用 var tabs = TabController.GetTabsByParent(-1, PortalId);

然后,您可以过滤该选项卡列表以删除菜单中未显示的任何选项卡。像下面这样的东西。

var tabs = TabController.GetTabsByParent(-1, PortalId);
            foreach (var t in tabs)
            {
                if (t.IsVisible)
                {
                    Response.Write(t.TabName);
                    Response.Write("<br />");
                }
            }

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.

var tabs = TabController.GetTabsByParent(-1, PortalId);
            foreach (var t in tabs)
            {
                if (t.IsVisible)
                {
                    Response.Write(t.TabName);
                    Response.Write("<br />");
                }
            }
漫漫岁月 2024-12-17 18:40:45

Linq 的一点点制作是干净整洁的

Dim pages = (From tc In TabController.GetTabsByParent(-1, PortalId)
             Where tc.IsVisible And Not tc.IsDeleted
             Select tc).ToList

A little bit of Linq makes is nice and clean

Dim pages = (From tc In TabController.GetTabsByParent(-1, PortalId)
             Where tc.IsVisible And Not tc.IsDeleted
             Select tc).ToList
围归者 2024-12-17 18:40:45

我还必须检查该页面是否已删除或者我是否出现了僵尸页面。

var tabs = TabController.GetTabsByParent(-1, PortalId);
        foreach (var t in tabs)
        {
            if (t.IsVisible && !t.IsDeleted)
            {
                Response.Write(t.TabName);
                Response.Write("<br />");
            }
        }

I had to also check if the page was deleted or I was getting zombie pages to show up.

var tabs = TabController.GetTabsByParent(-1, PortalId);
        foreach (var t in tabs)
        {
            if (t.IsVisible && !t.IsDeleted)
            {
                Response.Write(t.TabName);
                Response.Write("<br />");
            }
        }
避讳 2024-12-17 18:40:45

使用上面的帮助到达这里:

List<DotNetNuke.Entities.Tabs.TabInfo> tabs = TabController.GetTabsByParent(-1, 0).FindAll(
         delegate(DotNetNuke.Entities.Tabs.TabInfo tab)
         {
             return tab.IsVisible && !tab.IsDeleted;
         }
        );

Used the help from above to get here:

List<DotNetNuke.Entities.Tabs.TabInfo> tabs = TabController.GetTabsByParent(-1, 0).FindAll(
         delegate(DotNetNuke.Entities.Tabs.TabInfo tab)
         {
             return tab.IsVisible && !tab.IsDeleted;
         }
        );
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文