Hello,
I am trying to replicate and extend the native breadcrumbs control. I have made a copy of the files but in the code behind, I am not able to compile the code because it uses Globals.DependencyProvider that is marked as internal to the platform. This is used to get the INavigationManager.
In this PR ( https://github.com/dnnsof...orm/pull/2795 ) is the correct way of using DI, using the correct base classes, but for what I can see, this was not implemented in the SkinObjectBase.
So I think I have 2 options: - Request that SkinObjectBase also has access to the DI; - Use another class as base for this control. Ex: SkinBase already has a navigation manager accessible.
Does anyone have some kind of advice on how to go from here?
Thanks!
Maybe not a direct anwer to your question but you can also create breadcrumbs using DDR menu. As that's fully templatable, there might not be a need to fork the breadcrumbs at all.
Examples: https://demo.40fingers.ne...Examples/Breadcrumbs
Tanks Timo and Joe! Wow, the power of DDR is almost infinite. I managed to use it with one of the Timo's templates for breadcrumbs and added some TemplateArguments so I can implement my logic. The goal was to add special links connecting parent / child portals based on portal settings and that was accomplished. Thanks guys! In case someone else is looking for a similar solution, this is what I've done: Created an ASCX for my breadcrumb control.
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AlgoBreadCrumbs.ascx.cs" Inherits=".....AlgoBreadCrumbs" %> <%@ Register TagPrefix="ddr" TagName="MENU" Src="~/DesktopModules/DDRMenu/Menu.ascx" %> <%@ Register TagPrefix="ddr" Namespace="DotNetNuke.Web.DDRMenu.TemplateEngine" Assembly="DotNetNuke.Web.DDRMenu" %> <ddr:menu id="mnuBreadCrumb" menustyle="Menus/Breadcrumbs" runat="server">
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AlgoBreadCrumbs.ascx.cs" Inherits=".....AlgoBreadCrumbs" %>
<%@ Register TagPrefix="ddr" TagName="MENU" Src="~/DesktopModules/DDRMenu/Menu.ascx" %>
<%@ Register TagPrefix="ddr" Namespace="DotNetNuke.Web.DDRMenu.TemplateEngine" Assembly="DotNetNuke.Web.DDRMenu" %>
<ddr:menu id="mnuBreadCrumb" menustyle="Menus/Breadcrumbs" runat="server">
public partial class AlgoBreadCrumbs : SkinObjectBase { public string ParentPortalLink { get; set; } = "https://someportal"; public string ParentPortalName { get; set; } = "Parent Portal"; /*DDR menu structure and parames takenfrom this thread: https://dnncommunity.org/forums/aft/1286#4501 */ public AlgoBreadCrumbs() { } protected override void CreateChildControls() { base.CreateChildControls(); SetMenuTemplateArgs(); } private void SetMenuTemplateArgs() { if (mnuBreadCrumb.TemplateArguments == null) mnuBreadCrumb.TemplateArguments = new System.Collections.Generic.List(); mnuBreadCrumb.TemplateArguments.Add(new DotNetNuke.Web.DDRMenu.TemplateEngine.TemplateArgument { Name = "ParentPortalLink", Value = ParentPortalLink }); mnuBreadCrumb.TemplateArguments.Add(new DotNetNuke.Web.DDRMenu.TemplateEngine.TemplateArgument { Name = "ParentPortalName", Value = ParentPortalName }); } }
public partial class AlgoBreadCrumbs : SkinObjectBase { public string ParentPortalLink { get; set; } = "https://someportal"; public string ParentPortalName { get; set; } = "Parent Portal";
/*DDR menu structure and parames takenfrom this thread: https://dnncommunity.org/forums/aft/1286#4501 */ public AlgoBreadCrumbs() { }
protected override void CreateChildControls() { base.CreateChildControls(); SetMenuTemplateArgs(); }
private void SetMenuTemplateArgs() { if (mnuBreadCrumb.TemplateArguments == null) mnuBreadCrumb.TemplateArguments = new System.Collections.Generic.List();
mnuBreadCrumb.TemplateArguments.Add(new DotNetNuke.Web.DDRMenu.TemplateEngine.TemplateArgument { Name = "ParentPortalLink", Value = ParentPortalLink }); mnuBreadCrumb.TemplateArguments.Add(new DotNetNuke.Web.DDRMenu.TemplateEngine.TemplateArgument { Name = "ParentPortalName", Value = ParentPortalName }); } }
xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:output method="html" xsl:param name="ParentPortalLink" xsl:param name="ParentPortalName"
xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xsl:output method="html"
xsl:param name="ParentPortalLink"
xsl:param name="ParentPortalName"
Once again, thanks guys!
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.