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

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryCategory  Name filter Category Name filter
Previous
 
Next
New Post
11/26/2006 6:48 PM
 
Hi all. I just did a quick mod to the repository that you may be interested in. I wanted to be able to place pre filtered  category repository modules on various pages of my site. After I did a quick mod this is now possible. One really useful thing is that by using Category Name rather than ID you can have multiple repositories (with the same category name structure) on one page all filtered the same way. eg say you have a main file library repository and a business directory repository but on some sub pages you just want specifically filtered info eg State rather than whole of country.

New Stored procedure

CREATE procedure dbo.grmGetSingleRepositoryCategoryID

@CategoryName nvarchar(200)

as

select *

from dbo.grmRepositoryCategories

where  Category = @CategoryName

GO

 

 

Repository Module Code

In SQLDataProvider.vb

In #Region "RepositoryCategoryController"

        Public Overrides Function GetSingleRepositoryCategoryID(ByVal CategoryName As String) As IDataReader

            Return CType(SqlHelper.ExecuteReader(ConnectionString, DatabaseOwner & ObjectQualifier & "grmGetSingleRepositoryCategoryID", GetNull(CategoryName)), IDataReader)

        End Function

 

In DataProvider.vb

In #Region "RepositoryCategory"

Public MustOverride Function GetSingleRepositoryCategoryID(ByVal CategoryName As String) As IDataReader

 

In RepositoryDB.vb

In #Region "RepositoryCategory"

Public Class RepositoryCategoryController

        Public Function GetSingleRepositoryCategoryID(ByVal CategoryName As String) As RepositoryCategoryInfo

            Return CType(CBO.FillObject(DataProvider.Instance().GetSingleRepositoryCategoryID(CategoryName), GetType(RepositoryCategoryInfo)), RepositoryCategoryInfo)

        End Function

 

 

In Repository.ascx.vb

In Private Sub Page_Load

 

UNDER                 If Request.QueryString("grm2catid") <> "" Then

                    oRepositoryBusinessController.g_CategoryId = CInt(Request.QueryString("grm2catid"))

                    mFilter = ""

                End If

 

 

Add            If Request.QueryString("catname") <> "" Then

                    Dim strCategoryName As String = ""

 

                    ''get catname from querystring

                strCategoryName = Request.QueryString("catname")

 

                ''get catid from DB

                Dim categories As New RepositoryCategoryController

                Dim objCategory As New RepositoryCategoryInfo

                objCategory = categories.GetSingleRepositoryCategoryID(strCategoryName)

                oRepositoryBusinessController.g_CategoryId = objCategory.ItemId

                 mFilter = ""

            End If



 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsRepositoryRepositoryCategory  Name filter Category Name filter


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