1

I would like to create a module that has some behind the scene custom javascript embedded into the header section of the page. A div box that the javascript populate. (I was thinking of some google chart/map example).

My problem is that the guides i find, seem to expect somewhat abit of knowledge of creating modules and such and im all new to it, so hoping someone here could outline the steps i need or the guides that really covers this from bottom, not just the first google results as I have been over them and still havent made my lille sample module.

A module with a red div box, where some javascript from the header section adds some text to the div box will be a good example for me to learn from.

Hope someone can point me in the right direction.

  1. First step.
    I managed to get a local site running, creating a sample module and adding hello world to the view. 10min by selecting the webmatrix install for dnn installing and setting all the site hosting up and running and install of dnn into a sql mdl express file vent without any errors.

  2. Second step
    How to add some javascript to the header of the page whenever the module is loaded.

  3. How to do a package like the blog module, that add multiply module/controllers to a page. Thinking of having a main module that shows a google map, and a controller module that have some actions/settings that will trigger stuff on the map.

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
Poul K. Sørensen
  • 16,950
  • 21
  • 126
  • 283

1 Answers1

1

To get started with module development I recommend checking out the Wiki page on Module Development

http://www.dotnetnuke.com/Resources/Wiki/Page/Module-Development.aspx

Also check out my module development templates for Visual Studio http://christoctemplate.codeplex.com/

update: To utilize the JS/CSS inclusion features in DNN 6.1+ check out this wiki entry http://www.dotnetnuke.com/Resources/Wiki/Page/Client-Resource-Management-API.aspx

Chris Hammond
  • 8,873
  • 1
  • 26
  • 34
  • By first impression it seems like a rather long process of just getting the environment up and running. But taking a deeper look into it tomorrow. – Poul K. Sørensen Dec 13 '11 at 00:10
  • Okay, first steps are somewhat easy after all. I got a local site running with a new module on it. The next part of my question is then, seeing that when i put markup into the view it shows up. How will i now add javascript code to the header of the page whenever this module is in use. (want it to load a google map and some layers to it). – Poul K. Sørensen Dec 13 '11 at 02:23
  • I added an additional item to the original answer, which talks about the new features in 6.1 for including files. http://www.dotnetnuke.com/Resources/Wiki/Page/Client-Resource-Management-API.aspx – Chris Hammond Dec 13 '11 at 04:41
  • Thank You, looks like everything i need. Any comment on how to pack a set of modules into one pack like the blog module. Or is it a bad approach for making the main module and a controlling module for it? – Poul K. Sørensen Dec 13 '11 at 13:55
  • You can do so by simply adding new module definitions to the .DNN file. – Chris Hammond Dec 15 '11 at 20:36
  • Got everything to work. Only bit that I find cumbersome are to really do modules, to get references to work while developing. Paths to match, i have to open the hole site of dnn in visual studio(opened from webmatrix). By paths i mean, having javascript files in the solution of the module as an example. I guess a little more playing around will lead to a good pattern for when doing a new module. – Poul K. Sørensen Dec 15 '11 at 22:37
  • Personally I recommend following my recommended environment configuration in the Wiki, it makes doing things far more manageable than Web Matrix does. – Chris Hammond Dec 20 '11 at 22:06