在DNN 9中-如何显示活动页面的根级父级的名称和链接? [英] In DNN 9 - How do I display the name and link of the Active Page's Root level Parent?

查看:81
本文介绍了在DNN 9中-如何显示活动页面的根级父级的名称和链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在皮肤.ascx文件中添加在此论坛上找到的一些代码,以显示活动页面根级别父级的名称和链接。我正在使用DNN 9.1.1。
在这里找到代码:
如何获得姓名& DNN中父页面的链接

 < a href =<%=((DotNetNuke.Entities。 Tabs.TabInfo)PortalSettings.ActiveTab.BreadCrumbs [0])。FullUrl%><%=((DotNetNuke.Entities.Tabs.TabInfo)PortalSettings.ActiveTab.BreadCrumbs [0])。TabName%>< ; / a> 

它在视觉上有效,但是我遇到了一些奇怪的问题。添加代码后,在编辑模式下,它使class = DNNAjaxPanel div消失。当您将模块拖到内容面板中时,该div可以提供帮助。它是此div上方的div class = DNNEmptyPane dnnSortable dnnModuleManager ui-sortable



使用浏览器的Inspect Element功能,您将明白我的意思。 / p>

这里是div类= DnnAjaxPanel的屏幕快照,在我使用代码之前就已经存在:
使用div class = DnnAjaxPanel拍摄的屏幕截图



当我添加代码,使该div消失。然后,当我向该内容窗格中添加一个模块时,无论它们当前位于哪个其他内容窗格中,它都会使所有模块都转到该窗格。



这是一个错误吗? DNN 9.1.1还是不能在我的皮肤ascx文件中使用代码?



谢谢,
Craig

解决方案

您可能正在使用VB外观。您可以在页面顶部使用语言进行检查:<%@控制语言= vb AutoEventWireup = false



以下代码可与DNN 9一起使用。

 < a href =< ;%= CType(PortalSettings.ActiveTab.BreadCrumbs(0),DotNetNuke.Entities.Tabs.TabInfo).FullUrl%"> 
<%= CType(PortalSettings.ActiveTab.BreadCrumbs(0),DotNetNuke.Entities.Tabs.TabInfo).TabName%>
< / a>

C#版本

 < a href =<%=((DotNetNuke.Entities.Tabs.TabInfo)PortalSettings.ActiveTab.BreadCrumbs [0])。FullUrl%>> 
<%=(((DotNetNuke.Entities.Tabs.TabInfo)PortalSettings.ActiveTab.BreadCrumbs [0])。TabName%>
< / a>


I am trying to add some code I found on this forum in my skin .ascx file to display the name and link of the Active Page's Root level Parent. I am using DNN 9.1.1. Here is where I found the code: How to get name & link of parent page in DNN

<a href="<%= ((DotNetNuke.Entities.Tabs.TabInfo)PortalSettings.ActiveTab.BreadCrumbs[0]).FullUrl %>"><%= ((DotNetNuke.Entities.Tabs.TabInfo)PortalSettings.ActiveTab.BreadCrumbs[0]).TabName %></a>

It works visually, but I am getting some weird issues. With the code added, while in the edit mode, it makes a class="DNNAjaxPanel" div disappear. This div is used to help when you drag a module into a Content Panel. It is the div just above this div class="DNNEmptyPane dnnSortable dnnModuleManager ui-sortable"

Use the Inspect Element feature of your browser and you will see what I mean.

Here is a Screen shot with the div class="DnnAjaxPanel" that is there before I use the code: Screen shot with div class="DnnAjaxPanel"

When I add the code it makes that div disappear. Then when I add a module to that Content Pane it makes all the modules go to that one Pane no matter what other content pane they are currently in.

Is this a bug with DNN 9.1.1 or can I not use the code in my skin ascx file?

Thanks, Craig

解决方案

You Are probably using a VB skin. You can check this at the top of the page with "language": <%@ Control Language="vb" AutoEventWireup="false"

The below code works with DNN 9, tested it.

<a href="<%= CType(PortalSettings.ActiveTab.BreadCrumbs(0),DotNetNuke.Entities.Tabs.TabInfo).FullUrl %>">
    <%= CType(PortalSettings.ActiveTab.BreadCrumbs(0),DotNetNuke.Entities.Tabs.TabInfo).TabName %>
</a>

C# version

<a href="<%= ((DotNetNuke.Entities.Tabs.TabInfo)PortalSettings.ActiveTab.BreadCrumbs[0]).FullUrl %>">
    <%= ((DotNetNuke.Entities.Tabs.TabInfo)PortalSettings.ActiveTab.BreadCrumbs[0]).TabName %>
</a>

这篇关于在DNN 9中-如何显示活动页面的根级父级的名称和链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆