Hi, I am new to dotnetnuke and kinda lost of what next I need to do to accomplish my task, please see below what I am trying to do:
I am trying to add a link to the footer component. The link text is there ( I can see it) but when I click on the link it shows nothing, it doesn't load the text from the resx file, like other links do.
Here is what I did in code
in \Admin\Portal added
.ascx
<%@ Control Language="C#" AutoEventWireup="false" Inherits="DotNetNuke.Common.Controls.Copyright" CodeFile="Copyright.ascx.cs" %>
<div class="dnnPrivacy dnnClear"><asp:Label ID="lblPrivacy" Runat="server" /></div>
.ascx.cs file
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
if (!Page.IsPostBack)
{
lblPrivacy.Text = "test";
}
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
in \admin\Skins
.ascx
<%@ Control Language="C#" AutoEventWireup="false" Inherits="DotNetNuke.UI.Skins.Controls.Copyright" CodeFile="Copyright.ascx.cs" %>
<asp:hyperlink id="hypCopyright" runat="server" cssclass="SkinObject" enableviewstate="False"></asp:hyperlink>
ascx.cs
public partial class Copyright : SkinObjectBase
{
private const string MyFileName = "Copyright.ascx";
public string CssClass { get; set; }
public string Text { get; set; }
private void InitializeComponent()
{
}
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
InitializeComponent();
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
if (!String.IsNullOrEmpty(CssClass))
{
hypCopyright.CssClass = CssClass;
}
if (!String.IsNullOrEmpty(Text))
{
hypCopyright.Text = Text;
}
else
{
hypCopyright.Text = string.Format(Localization.GetString("Copyright", Localization.GetResourceFile(this, MyFileName)), DateTime.Now.Year, "Test");
}
hypCopyright.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Copyright");
hypCopyright.Attributes["rel"] = "nofollow";
}
catch (Exception exc)
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
}
I think it fails in line:
hypCopyright.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Copyright");
because if I modify the "copyright" text to "privacy",where privacy came with the installtion it works, the link points to the privacy resource file.
How do I add new "copyright" in the Global.NavigationURL? where is this function found?
I hope it is clear what I am trying to do,
Thanks