Hi ShadsTrains,
How to add custom button to DNN instance?
1. Open project 'Provider.sln'(you can find this project in download package 'Providers\HtmlEditorProviders\CEHtmlEditorProvider')
2. Open file 'CEHtmlEditorProvider.vb' in the project above
3. Find section below
-
Protected Sub cntlCE_Load(ByVal sender As Object, ByVal e As EventArgs) Handles cntlCE.Load
-
Try
-
AddDNNLinks()
-
Catch ex As Exception
-
Throw New Exception("Check your provider configuration for errors!" & Environment.NewLine & ex.Message)
-
End Try
-
End Sub
Change to
-
Protected Sub cntlCE_Load(ByVal sender As Object, ByVal e As EventArgs) Handles cntlCE.Load
-
Try
-
Dim tc As CuteEditor.ToolControl = cntlCE.ToolControls("insertcustombutonhere")
-
Dim button1 As New System.Web.UI.HtmlControls.HtmlButton()
-
button1.InnerText = "message"
-
tc.Control.Controls.Add(button1)
-
button1.Attributes("onclick") = "alert('hello')"
-
tc.Control.Controls.Add(button1)
-
AddDNNLinks()
-
Catch ex As Exception
-
Throw New Exception("Check your provider configuration for errors!" & Environment.NewLine & ex.Message)
-
End Try
-
End Sub
4. Build this project
5. Use the new file 'DotNetNuke.CEHtmlEditorProvider.dll' to replace the old in the bin folder of your dnn site
6. When these done, you will see a button on the toolbar of the final
Regards,
Ken