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...Administration ...Administration ...Best practices/Recommendations for modifying Source CodeBest practices/Recommendations for modifying Source Code
Previous
 
Next
New Post
3/17/2017 1:33 PM
 

I know it's not good practice to modify the source code because any changes may conflict with future upgrades. I was wondering if anyone had any suggestions on how to modify existing modules. An example is, I want to show different information for the member directory. I see that the member directory has ItemTemplate.htm and I could probably just retrieve the information I want to display and bind it to the view. But again, that's not a good practice right? I have heard I can create an instance of a module and inherit the functionality? Does anyone have any examples of this? 

Thank you very much ahead of time.

 

 
New Post
3/17/2017 8:56 PM
 
If you want to modify a module, and you have the source code, I think that the best practice is to create a new installable package. You might even want to modify the module so that it has a different name, and uses different namespaces. Maybe even different tables, stored procedures, and the like. By doing that, your modified version is YOURS and will not be overwritten or changed by any other module changes.

I've done that with modules, with custom authentication providers, custom skin objects, and the like.

It promotes healthy sleep patterns, too!




Joe Craig
Patapsco Research Group, Ellicott City, MD
DotNetNuke Development and Services (http://patapscorg.com)
 
New Post
3/18/2017 10:06 AM
 
I agree with Joseph, that you should "fork" the module and use a custom module name and namespace in your version to prevent conflicts, if the original module gets accidently installed during a DNN upgrade.
If you just want to modify Membership templates, you may edit it in Module Settings, your version will be saved in TabModuleSettings table of the database and not be modified on DNN upgrades. However be aware about some shortcomings of the module - sometimes I found it preferable using Reports module instead.

Cheers from Germany,
Sebastian Leupold (Microsoft MVP)

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
3/20/2017 12:18 PM
 

Thank you for your reply.

In a case when I don't have the source code, what is recommended? Can I inherit objects and methods from that module that exists in DNN's library and create a new module from that? 

 
New Post
3/21/2017 4:12 PM
 
If you don't have the source code, your original question about best practices in modifying source code doesn't make sense.

You can certainly reference methods from components of other modules. I'm not sure that this is much of a help. What do you do if that other module is modified or updated?



Joe Craig
Patapsco Research Group, Ellicott City, MD
DotNetNuke Development and Services (http://patapscorg.com)
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Best practices/Recommendations for modifying Source CodeBest practices/Recommendations for modifying Source Code


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