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...Building ExtensionsBuilding ExtensionsModulesModulesUp to date example/tutorial for more complex moduleUp to date example/tutorial for more complex module
Previous
 
Next
New Post
3/7/2014 5:43 PM
 

Nearly all the current tutorials or examples I've seen for DAL2 / knockout.js revolve around very simplistic modules. One table, one view, one edit. That's nice to start but unfortunately nothing I need to do is that simple. What I'm looking for is a current "real-world" example that would have a lookup table, a master row, and detail rows owned by them. An example of that would be a contact list, but one that has a contact type table referenced from the contact table, and 1-n Address rows attached to the contact.

The books are all DNN5, as are the tutorial videos on the dotnetnuke.com that I've found.

My templates that do more complex modules are based off DNN4/5, and I really would like to update them so they could create modules based off current best practices. Doing a complex module "by hand" is WAY to much typing when you have numerous tables, so I don't want to start down the road just by using the Christoc or DNNuclear VS templates and key in everything else to upgrade.

I've been hunting, gone through all the DNNHero videos, etc, but I could really use a good example to go by and if that example has some good documentation to go with all the better.

 

 

 
New Post
3/7/2014 9:42 PM
 
Hey Keith Stone, I may have two answers for you. The first (hopefully the easiest) is to download the reports module and it is free.. I use it a lot for what you are talking about. It gives you a section (under settings) to write a select statement then outputs it in a viewable table format. AN example of this that I use is: One of my select statement: SELECT u.Email, upd.FirstName, upd.LastName, upd.Telephone, Upd.Committee FROM dbo.Users AS u LEFT OUTER JOIN (SELECT up.UserID, MAX(CASE WHEN ppd.PropertyName = 'FirstName' THEN up.PropertyValue ELSE '' END) AS FirstName, MAX(CASE WHEN ppd.PropertyName = 'LastName' THEN up.PropertyValue ELSE '' END) AS LastName, MAX(CASE WHEN ppd.PropertyName = 'Telephone' THEN up.PropertyValue ELSE '' END) AS Telephone, MAX(CASE WHEN ppd.PropertyName = 'Committee' THEN up.PropertyValue ELSE '' END) AS Committee FROM dbo.UserProfile AS up INNER JOIN dbo.ProfilePropertyDefinition AS ppd ON up.PropertyDefinitionID = ppd.PropertyDefinitionID and ppd.PortalID = 0 Group By up.UserID) as upd on u.UserID = upd.UserID Where Upd.Committee >' ' ORDER BY Committee The output is like this: ________________________________________________________________________________ |___email______________|FirstName___|LastName___|Phone Number_|Committee____________| |myemail@domain.com |Scott |Price | (123)555-1234 |Website Committee | |---------------------------------------------------------------------------------------------------------------------------------------------| |myemail2@domain.com |Bill | Sanders | (123555-1111 |Association Committee | ---------------------------------------------------------------------------------------------------------------------------------------------- The other, would be to give you an example of a module I am creating, that works up to now, but I'm not done with it. I am using the module creator. It is a bit tedious and time consuming, but you get the module to do what you want it to and that is worth its weight in gold to me. I can either email/message it to you (as it does not show up great in the forms) or you can find most of it here: http://stackoverflow.com/questions/22... The only problem with the stack overflow link is that people have messed with the script so much that it will not work if copied and pasted. I can email/message you the files that I have created to see an example. This will give you the basic building blocks for building a module. I had looked everywhere for a tutorial on it and there was nothing worth wile out there. I self taught myself through trial and error over some time. If you need explaining of what is what and how to make a custom module work I can try my best to explain it....... The script that I wrote basically outputs/looks like this: Send Mail To: (?) [___________] Send Mail From: (?) [__________] Subject: (?) [__________] _______________ Message:(?) | | | | | | |_______________ | ________________ [Send Email Button] --------------------------- Let me know if either of these answers can help you or what else I can do to help!! Here is my scripts but I dobt they will show up right: View.ascx <%@ Control Language="C#" AutoEventWireup="false" Inherits="Scott.SendEmail.View" CodeFile="View.ascx.cs" %> <%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %> <%@ Register TagPrefix="dnn" TagName="TextEditor" Src="~/controls/TextEditor.ascx"%>
View.ascx.rs Send Mail To: Select who you would like to send email to. Seporate by mutlple addresses with a ; Email Subject: Enter the subject for the email you are sending. Email Message: Enter the Message for the email you are sending. view.ascx.cs #region Copyright // // Copyright (c) 2014 // by Scott // #endregion #region Using Statements using System; using DotNetNuke.Entities.Modules; #endregion namespace Scott.SendEmail { public partial class View : PortalModuleBase { #region Event Handlers protected override void OnInit(EventArgs e) { base.OnInit(e); cmdSave.Click += cmdSave_Click; } protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack) { txtField.Text = (string)Settings["field1"]; } } protected void cmdSave_Click(object sender, EventArgs e) { ModuleController controller = new ModuleController(); controller.UpdateModuleSetting(ModuleId, "To", txtField.Text); controller.UpdateModuleSetting(ModuleId, "Subject", txtField2.Text); controller.UpdateModuleSetting(ModuleId, "Message", txtField3.Text); DotNetNuke.Services.Mail.Mail.SendMail( "Admin@MarltonLakes.com",txtField.Text, String.Empty,txtField2.Text, txtField3.Text, String.Empty, "html" , String.Empty,String.Empty,String.Empty, String.Empty);Response.Redirect("http://www.MarltonLakes.com"); } #endregion } } Settings.Ascx <%@ Control Language="C#" AutoEventWireup="false" Inherits="Scott.SendEmail.Settings" CodeFile="Settings.ascx.cs" %> <%@ Register TagPrefix="dnn" TagName="Label" Src="~/controls/LabelControl.ascx" %>
Settings.ascx.res Default email address Enter the default email address. SQL input: SQL Help Settings.ascx.cs #region Copyright // // Copyright (c) 2014 // by Scott // #endregion #region Using Statements using System; using DotNetNuke.Entities.Modules; using DotNetNuke.Services.Exceptions; #endregion namespace Scott.SendEmail { public partial class Settings : ModuleSettingsBase { #region Base Method Implementations public override void LoadSettings() { try { if (!Page.IsPostBack) { txtField1.Text = (string)TabModuleSettings["field1"]; } } catch (Exception exc) // Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } } public override void UpdateSettings() { try { ModuleController controller = new ModuleController(); controller.UpdateTabModuleSetting(TabModuleId, "field1", txtField1.Text); } catch (Exception exc) // Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } } #endregion } }
 
New Post
3/7/2014 9:50 PM
 
Disreguard my attempts to show you what the outputs are... they got messed up when posting, sorry
 
New Post
3/8/2014 1:30 PM
 
theres not much DAL2 in DNN platform but there are plenty of good knockoutjs examples - check out coremessaging, journal or memberdirectory for a good example. I went through my bookmarks list and added a bunch of useful links to the DAL2 page which should hopefully help - http://www.dnnsoftware.com/wiki/page/...

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesUp to date example/tutorial for more complex moduleUp to date example/tutorial for more complex module


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