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...DNN Platform (o...DNN Platform (o...Extending the SettingsExtending the Settings
Previous
 
Next
New Post
8/30/2011 3:44 PM
 
Ok.  I'm stumped.  I'm working in Dnn 6.0.1 and I need to add functionality to the basic Text/HTML core module 'edit' settings.  There are two pieces I would like to incorportate into this.  The first is a version comparison tool that pulls two version from the database and compares them side by side highlighting changes (I have this code written in a simple aspx page).  The second piece of code I need to incorporate is code to display older versions of the HTML content in the full page as it looked at the time it was published (a better looking version of the preview panel in the edit panel).  I had hoped ot utilize the preview skin but pass in verison of the HTML being reviewed to display the full page that can be printed etc.

Here is my issue.  I need to change the Text/HTML Settings page to include two additional expansion panels where I can insert this new code without changing the core code. We do not want to keep up with the changes and have to repeat them when we upgrade hence I have been asked by my boss to find another way.  I have looked into the ClientAPI, RazorScript, and jQuery and still not come up with a simple way to accomplish what I am trying to do.  I would love to write a custom module that loads the Text/Html module into it as a control and extends the funactionality as needed with my additional code.  There are several things I have read that hint at doing something of this nature, but I can not find anything to tell me how or if this can really be done.  Any help or direction anyone can provide would be greatly appreciated.

Thanks,
Jeff
 
New Post
8/31/2011 1:23 PM
 
theres a number of ways - of course you can simply copy the html module, update it's references (e.g. in the dnn manifest etc.) to make it your own custom version and then add the changes. This has the advantage of giving you full control but the disadvantage that you dont benefit from core bug fixes/enhancements. Another approach is to augment it with code from elsewhere injected into it's scope - http://www.dotnetnuke.com/Resources/Blogs/EntryId/2868/DotNetNuke-Tips-and-Tricks-23-Extending-the-Blog-Module.aspx is a good example of using jquery and http://www.dotnetnuke.com/Resources/Blogs/EntryId/3055/DotNetNuke-Tips-and-Tricks-25-Module-Magic-with-Form-and-List.aspx is an example of using razor. Finally, you can of course simply use LoadControl to load the control itself (some of the aggregator/tabbed view modules us this approach to merge multiple modules into 1 module.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
8/31/2011 3:46 PM
 
Cathal,

Thanks for your prompt response!  In researching this further it looks like I will also have to add header.text to the resource file to remain consistent with the other programming in the core module, if I adhear to standards.  Even with the most minor change to the resource file and just adding a line or two to the jquery in the bottom of the control, I am still modifying the core source which would have to be revisited when an update occurs and of course the code will be spred out across modules.  While I did find information that was helpful in extending the class so that additional functions could be added to the control, based on what you sent it does not appear that what I am trying to accomplish can be done in the framework without making at least some minor changes to the code.  If there is something I am missing in these articles please let me know. 

Since it looks like I am going to have to change the core code regardless of the method I use to enhance it, I am going to try to change the code in the least amount possible.  My current plan is to create a user control and use the LoadControl method to push the code into a placeholder within the Edit control.  This seems like it will allow me to embed the core functionality I am trying to accomplish within the custom user control/dll while only having to add a placeholder in the edit control when an update occurs.  Does this seem like a viable plan or do you suggest another method?

Thanks,
Jeff
 
New Post
8/31/2011 7:42 PM
 
no, unless you can identify an existing field to inject content to you'll have to add your own field (note: you can update the header text via jquery easily enough). The problem is that whilst it's typically easy enough to use LoadControl and explicitly load an existing ascx thats easy for view controls but not so easy if you want to support all controlkeys of a module.At a certain point making your own fork becomes the easiest option - or else submitting your code as an enhancement at support.dotnetnuke.com so that (if found desirable and correct) we can build it into the root module meaning you dont have to on updates and the wider community benefits.

How you do this fork is up to you i.e. add code to the existing ascx pages or clone the module and do it in there - or even just update the html modules view control to point to a new ascx that hosts 2 user controls , one for your functionality and one for the existing html control (the last would mean only running a database update to reset the src to the updated one after a core module update -note:ive not tried this option before.

Finally depending on your needs you may be able to use the decorator pattern to add the functionality - http://en.wikipedia.org/wiki/Decorato...

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
9/1/2011 10:30 AM
 
Cathal,

Thanks again for your prompt response! You have been greatly helpful in determining how this quandry needs to be resolved. My company currently has a professional license and while I have the compiled code available for use via this license, it does not apparently include the source code so I can extend the module per our discussion. I have requested additional information from support.dotnetnuke.com to provide enough information to explain the development issue to my management. If I am able to obtain the source code I will be sure to create an additional fork of the code, and submit it to support so the community can benefit (hopefully).

Thanks again for you assistance!

Jeff
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Extending the SettingsExtending the Settings


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