Forum


HomeHomePremiumPremiumDevelopmentDevelopmenthow to make dnn search function work with razor modulehow to make dnn search function work with razor module
Previous
 
Next
New Post
10/10/2014 7:26 PM
 

Hello, I've created a razor module using the module creator.  The module simple pulls information from the sql db and display it using some javascript.  However, I've noticed that the content is the razor module is not searchable in the DNN search.  How do i integrate it the dnn search so that it will index the content in the module as well. 

 
New Post
10/11/2014 5:25 AM
 

Andy,

Great question.  I have never tried this before, but I believe you will have to implement ModuleSearchBase in your Razor module just like you would any other module in order to get your module content into the DNN Search.  

For a Razor module, I am guessing you need to do the following:

  1. - Open module settings  > Develop
  2. - Add a new C# class file
  3. - Paste code like this:
    #region Using Statements
    using System;
    using System.Collections.Generic;
    using DotNetNuke.Entities.Modules;
    using DotNetNuke.Services.Search.Entities;
    #endregion
    
    namespace DotnetNuclear.SearchableRazorModule
    {
    	public class BusinessController : ModuleSearchBase
    	{
               public override IList GetModifiedSearchDocuments(ModuleInfo modInfo, DateTime beginDate)
               { 
                 return new List();
               } 
    	}
    }
    
  4. - Open Host > Extensions, Edit your Razor module package. Add business controller class, ie: DotnetNuclear.SearchableRazorModule.BusinessController
  5. - Then you will have to update the Search supported features flag. You may have to do this directly in the table

 

All other instructions for implementing ModuleSearchBase are in my tutorial:

http://www.dnnhero.com/Premium/Tutori...

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmenthow to make dnn search function work with razor modulehow to make dnn search function work with razor module



Try FREE
30 days money back guaranteed