Blueprint_Image_3.gif
The Patapsco Research Group
Blueprint_Image_3_flipped.GIF

Current Articles | Archives | Search

Sunday, June 06, 2010
Using Taxonomy in DotNetNuke
By host @ 10:05 AM :: 961 Views :: BlogEntry
 

Starting with DotNetNuke 5.3 there is a centralized Content store, together with the ability to apply Taxonomies (categories) to the content.  In simple terms, this lets you create tags and apply them to tabs (pages) and modules.

Recently I had a requirement to produce customized lists of pages in a DotNetNuke site that would be of interest to different groups of users.  I was able to do this in a straightforward manner by using this new feature.  This describes how I did it.

First, I created three tags, one for each group of users.  The Taxonomy page under Admin provides an empty Tags category.  I edited the Tags to include three new tags:  GroupA, GroupB and GroupC.

Next, I applied the new tags to all of the pages on the site.  These are set using the Page Settings for each page.

With each page tagged, it was time to produce the custom lists of pages for each category.  With a little fiddling, and with reference to Charles Nurse's blogs, I was able to create a SQL query that constructs a list of links to pages tagged with a specific tag.  Here is an example that creates a list of links to pages tagged with "GroupA":

 

select 

'<a href="http://mysite.com' + P.TabPath + '.aspx" >' + P.TabName + ' </a>'

from Taxonomy_Terms T

inner join ContentItems_Tags C on T.TermID=C.TermID
inner join ContentItems I on C.ContentItemID=I.ContentItemID
inner join Tabs P on I.TabID=P.TabID

where T.VocabularyID=1
and   T.Name='GroupA'

 

The final step was to place the list of links in a page.  I used the SGSV module from Tressleworks.ca to do it.  You could also use the Reports module, or any other module that lets you execute a SQL query.  Note -- if you use SGSV, you will need to check the "Decode encoded HTML" box in the Grid Options section of the module settings.  This will create proper links from the query. 

Comments
Copyright (c) 2012 Patapsco Research Group   Terms of Use  Privacy Statement   Login