Products

Solutions

Resources

Partners

Community

About

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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIDNN NavigationDNN Navigation
Previous
 
Next
New Post
1/8/2007 9:27 PM
 

Hey, this is intended toward all those developers out their regarding the DNN Navigation framework.  I've only been disecting how DNN renders menus for a short time and am in dire need to direction.

This is what I have so far... it's very close to the solpart actions class.  I wrote it almost convinced that it would work but the nodes that were rendered ended up being attributes in the parent SPAN of the DNN Menu.

What I am intending to do is just extract the action menu item nodes, nothing more, nothing fancy.  Not even formatted for HTML, I am content with a collection.  What I am intending to do with this is format the links (action menu) in a bullet list form, no drop down.

I'm not asking for a solution, but any guidance as to where to look is more than appreciated!  Thanks, Phil

 

using DotNetNuke;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.UI;
using DotNetNuke.UI.Utilities;
using DotNetNuke.UI.WebControls;
using System;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace DotNetNuke.UI.Containers
{
 public partial class myBusinessActions : UI.Containers.ActionBase
 {

  private Modules.NavigationProvider.NavigationProvider  objControl;
  private string           strProviderName     = "DNNMenuNavigationProvider";
  private DNNNodeCollection         objNodes;
  private int            objIntExpandDepth     =  -1;
  private bool           objBoolPopulateNodesFromClient = false;
  
  #region Properites
  public string ProviderName
  {
   get { return strProviderName; }
   set { strProviderName = value; }
  }
  public Modules.NavigationProvider.NavigationProvider Control
  {
   get { return objControl; }
   set { objControl = value; }
  }
  public int ExpandDepth
  {
   get { if (this.PopulateNodesFromClient = false) return -1; return objIntExpandDepth; }
   set { objIntExpandDepth = value; }
  }
  public bool PopulateNodesFromClient
  {
   get { return objBoolPopulateNodesFromClient; }
   set { objBoolPopulateNodesFromClient = value; }
  }
  #endregion
  
  protected override void OnPreRender(EventArgs e)
  {
   //this.BindMenu(Navigation.GetActionNodes(this.ActionRoot, this, this.ExpandDepth));
  }

  protected override void OnLoad (EventArgs e)
  {
   objControl = Modules.NavigationProvider.NavigationProvider.Instance(this.ProviderName);
   objNodes = Navigation.GetActionNodes(this.ActionRoot, this, Control.NavigationControl);
   Control.Initialize();
   Control.PopulateOnDemand += new Modules.NavigationProvider.NavigationProvider.PopulateOnDemandEventHandler(this.Control_PopulateOnDemand);
   myParentDiv.Controls.Add(Control.NavigationControl);
  }
  
  private void Control_PopulateOnDemand (Modules.NavigationProvider.NavigationEventArgs args)
  {
   this.ActionRoot.Actions.AddRange(this.PortalModule.Actions);
   Entities.Modules.Actions.ModuleAction objAction = this.ActionRoot;
   if (this.ActionRoot.ID != Convert.ToInt32(args.ID))
    objAction = this.GetAction(Convert.ToInt32(args.ID));
   if (args.Node == null)
    args.Node = Navigation.GetActionNode(args.ID, Control.ID, objAction, this);
   this.Control.ClearNodes();
   this.BindMenu(Navigation.GetActionNodes(objAction, args.Node, this, this.ExpandDepth));
  }
  
  private void BindMenu (DNNNodeCollection _objNodes)
  {
   this.Visible = DisplayControl(_objNodes);
   
   if (this.Visible)
   {
    this.Control.ClearNodes();
    foreach (DNNNode _objNode in _objNodes)
     ProcessNodes(_objNode);
    Control.Bind(_objNodes);
   }
  }
  
  private void ProcessNodes (DNNNode _objParent)
  {
   if (_objParent.JSFunction.Length > 0)
    ClientAPI.RegisterClientVariable(this.Page, objControl.NavigationControl.ClientID, _objParent.JSFunction, true);
   
   foreach (DNNNode _objNode in _objParent.DNNNodes)
    ProcessNodes(_objNode);   
  }
  
 }
}

 
New Post
1/9/2007 2:33 AM
 

http://www.dynamicvb.net/Portals/0/788163_ch08.pdf page 271  I'm wondering if this will me help out ?

namespace dotnetnuke.entities.modules
     public interface IActionable
          ReadOnly Property ModuleActions() As Actions.ModuleActionCollection

     end interface
end namespace

 
New Post
1/9/2007 9:13 AM
 
Have you read the DotNetNuke Navigation WebControls document?  I believe it provides you with the answers you are looking for.  Basically, it shows how to get your collection you were after.  Most likely you will simply want to create your own navigation provider to output the html you would like for module actions.  I suggest reviewing the DNNDropDownListNavigationProvider

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIDNN NavigationDNN Navigation


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