Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Getting StartedGetting StartedAdding Link to footer linksAdding Link to footer links
Previous
 
Next
New Post
5/16/2012 4:07 PM
 

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

 

 
New Post
5/16/2012 5:38 PM
 
It looks like you are going about things in the wrong fashion.

If the Footer link you're referring to is in a Module you would likely edit the content via a web browser, find the module's action menu (manage button) and choose the edit option.

If you are trying to modify the SKIN you should locate the skin you are using either in /portals/_default/skins/SKINNAME/ or /portals/0/skins/SKINNAME and edit the ASCX file there.

It is possible that 0 could be a different number, depending on how many portals you have.

You wouldn't typically edit any of the DotNetNuke ASCX files themselves, that is what we could call a core change, and while you can do that, it causes you more hurdles to jump through when you try to upgrade to a newer version of DotNetNuke in the future.

Chris Hammond
Former DNN Corp Employee, MVP, Core Team Member, Trustee
Christoc.com Software Solutions DotNetNuke Module Development, Upgrades and consulting.
dnnCHAT.com a chat room for DotNetNuke discussions
 
New Post
5/16/2012 6:31 PM
 

Hi Chris,

Thx for your reply, this is not a module. I am just modifying the index.ascx (main page) by adding another link to the footer links 

e.g

<span class="Footer-Sep">|</span><dnn:COPYRIGHT runat="server" ID="dnnCOPYRIGHT2" CssClass="Terms-Privacy"/>

so when clicking on copyright link, it redirects me to: http://localhost:6244/Home/tabid/55/ctl/Privacy/Default.aspx but it is blank it doesnt take the text from the resource file (resx) other links that came with  the index.ascx do work and they take the  text from the resx file. I believe it is something to do with line as I mentioned above:

do you know where the Globals.NavigateURL function is? I think it is standard.

     hypCopyright.NavigateUrl = Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "Copyright");

Thanks

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedAdding Link to footer linksAdding Link to footer links


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out