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

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...How to add a custom menu action in DNN 7How to add a custom menu action in DNN 7
Previous
 
Next
New Post
3/12/2014 9:17 AM
 
I can see that it's annoying that it used to work.

Sadly I think it's a reasonable restriction. In general a container cannot be certain that the module it surrounds can support that menu item so it really ought to be up to the module to decide what menu items to add.

I can see that you would not want to change every module - maybe you can at least write that code once and call it from each module?

Best wishes,
- Richard
Agile Development Consultant, Practitioner, and Trainer
www.dynamisys.co.uk
 
New Post
3/12/2014 9:21 AM
 
Hi Mona,

So you want a action for every module using your container ?

I use a skin object in a container to add an button to all my modules that are using that particular container.asxc

In the container ascx I made an reference to the skin object.

<%@ Register TagPrefix="dnn" TagName="HIDEMODULE" Src="Objects/HideModule.ascx" %>
and place the button somewhere in the ascx


The skinobject looks like this :
.ascx
<%@ Control language="vb" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Controls.HideModule" CodeFile="HideModule.ascx.vb" %>


.ascx.vb


Imports DotNetNuke.Entities.Tabs
Imports DotNetNuke
Imports DotNetNuke.Data
Namespace DotNetNuke.UI.Skins.Controls
''' -----------------------------------------------------------------------------
'''
'''
'''
'''
''' [cniknet] 10/15/2004 Replaced public members with properties and removed
''' brackets from property names
'''

''' -----------------------------------------------------------------------------
Partial Class HideModule
Inherits UI.Skins.SkinObjectBase
Const MyFileName As String = "HideModule.ascx"
Dim iCustomerid As String = 3
Dim iTab As Integer = 1
Dim iUserId As Integer
#Region " Web Form Designer Generated Code "
Private Sub InitializeComponent()

End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
'*******************************************************
' The Page_Load server event handler on this page is used
' to populate the role information for the page
'*******************************************************
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objUserInfo As UserInfo = Global.DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo()
iUserId = objUserInfo.UserID
End Sub
Function HideModule(ByVal tabid As String, ModuleId As String, iuserid As String) As String
Dim dr As IDataReader
Try
Dim str As String = "exec VL_AddHideModule " & iCustomerid & "," & iuserid.ToString() & "," & tabid.ToString() & "," & ModuleId.ToString()
dr = DotNetNuke.Data.DataProvider.Instance().ExecuteSQL(str)
dr.Read()
dr.Close()
Response.Redirect(Request.RawUrl)
Catch ex As Exception
Return "fout"

Finally

End Try

End Function
Protected Sub butHideModule_Click(sender As Object, e As ImageClickEventArgs) Handles butHideModule.Click
HideModule(TabController.CurrentPage.TabID, ModuleControl.ModuleContext.ModuleId, iUserId)
End Sub
End Class

End Namespace

Hope it
 
New Post
3/18/2014 8:16 AM
 
alternatively: adding the same action to all your custom modules is as easy as having your view control inherit from a common base control, and inject the action there.... (IMHO that is a better way to do it in the first place)

Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...How to add a custom menu action in DNN 7How to add a custom menu action in DNN 7


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