DotNetNuke Custom Module Creation Using DNNTemplate

Software Requirement

  1. Visual Studio 2012 Express
  2. SQL Server Express
  3. DotNetNuke Module Template for 2012 ( DNNTemplates )

Setup

  1. Install Visual Studio Express if you haven't already done.
  2. Install SQL Server Express if you haven't already done.
  3. Install DNNTemplates.

Steps To Create Custom Module

  1. Open Visual Studio 2012.

    Go to File, New, then Project,

    Project

  2. Select Appropriate Module Template form installed template. Specify Appropriate Module name and Folder location.

    Select Appropriate Module Template

  3. Click OK button. It starts creating the project and at the end it shows the following error message.

    Error

  4. To resolve this error, we need to make changes in solution file of created module.

    Click TestingModule.csproj file in Visual Studio.

  5. Make the following changes in TestingModule.csproj file.

    1. IISUrl
    2. IISAppRootUrl

    1. <ProjectExtensions>   
    2.     <VisualStudio>   
    3.       <FlavorProperties GUID="{31-65df-11da-9384-00065123321}">   
    4.         <WebProjectProperties>   
    5.           <UseIIS>True</UseIIS>   
    6.           <AutoAssignPort>False</AutoAssignPort>   
    7.           <DevelopmentServerPort>0</DevelopmentServerPort>   
    8.           <DevelopmentServerVPath>   
    9.           </DevelopmentServerVPath>   
    10.           <IISUrl>http://localhost/DNN/desktopmodules/TestingModule</IISUrl>   
    11.           <OverrideIISAppRootUrl>True</OverrideIISAppRootUrl>   
    12.           <IISAppRootUrl>http://localhost/DNN/</IISAppRootUrl>   
    13.           <NTLMAuthentication>False</NTLMAuthentication>   
    14.           <UseCustomServer>False</UseCustomServer>   
    15.           <CustomServerUrl>   
    16.           </CustomServerUrl>   
    17.           <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>   
    18.         </WebProjectProperties>   
    19.       </FlavorProperties>   
    20.     </VisualStudio>   
    21. </ProjectExtensions>  

     

     

  6. Open separate instance of custom module project in separate visual studio, so that we make coding changes.

    Open separate instance

  7. Steps to build complete DotNetNuke project along with custom module.

    1. Build TestingModule Project.
    2. Rebuild Main Solution of DotNetNuke Project.
    3. Run the solution in VS 2012.
    4. Login into DotNetNuke application.

    Login into DotNetNuke

  8. Sign in into DotNetNuke.

    DotNetNuke

Integration of custom module in DotNetNuke project

  1. Run Sql Script.

    1. Go to TestingModule Folder in Main Solution.
    2. Go to Providers, DataProviders, SqlDataProvider - 00.00.01.SqlDataProvider.
    3. Click 00.00.01.SqlDataProvider file having Sql queries.
    4. Go to Host -> SQL.
    5. Paste SQL query in the following window.

    SQL query

  2. Add Custom Module.

    1. Go to Host -> Extension.

    2. Select Create New Module.

    Extension

  3. Select appropriate option to create new Custom module. Click Create Module button.

  4. After Custom module created, it shows newly created module at extension page.

  5. Test Page added into application.   

  6. Add Module on test page as follow:

    1. Go to Module -> Add New Module.

    2. Drag and drop module on test page.

    3. When settings are correct, it will show you ‘add item’ option on test page.

     

  7. In case some settings are incorrect it will not show you add item option on test page, in that case we need to change your setting of Custom module.
  • Go to Host -> Extension.
  • Go to custom module we added in list.

      

  • Select Edit option.
  • Please check Module Control section properly as show in figure.

       

 !!! Happy Coding !!!

Up Next
    Ebook Download
    View all
    Learn
    View all